<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ST05 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531595#M1263737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi Expert,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Got a few questions here.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; 1. What does access predicates and filter predicates in ST05/Performance trace means? Does it influence anything when creating an index?&lt;/P&gt;&lt;P&gt;&amp;gt; 2. When you create an index, does the order of the column/field matters?&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Thanks in advance.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Eida,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. good statements made by others&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.  Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;creation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it comes to design an index you have to KNOW the queries that your application will fire to the table.&lt;/P&gt;&lt;P&gt;There is no general rule except that the index should fit with the access pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe your app would have a lot of queries of these types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from tab where col1 = x and col2 = y&lt;/P&gt;&lt;P&gt;select * from tab where col2 = y&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it would make sense to order the index keys that way: (COL2,COL1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;discriminating myth: "You should set the most discriminating index column in front ."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COL1: 10000000&lt;/P&gt;&lt;P&gt;COL2:   1000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myth suggested order: (COL1, COL2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you consider the columns C1 and C2 as vectors and have to compare them togehther in a WHERE it doesn't matter which comes first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore,  techniques like index key compression imply that you put the least discriminant in front&lt;/P&gt;&lt;P&gt;to get a good compression factor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 May 2009 13:28:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-05T13:28:35Z</dc:date>
    <item>
      <title>ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531589#M1263731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Expert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Got a few questions here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. What does access predicates and filter predicates in ST05/Performance trace means? Does it influence anything when creating an index?&lt;/P&gt;&lt;P&gt;2. When you create an index, does the order of the column/field matters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 17:34:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531589#M1263731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-30T17:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531590#M1263732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eida,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; What does access predicates and filter predicates in ST05/Performance trace means? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this information in an (ORACLE, since db specific) execution plan tells you what columns&lt;/P&gt;&lt;P&gt;of your where condition could be used to restrict the number of index pages that need to be&lt;/P&gt;&lt;P&gt;read (access predicates) and what columns of your where condition could be used for filtering&lt;/P&gt;&lt;P&gt;after reading index or table pages (filter predicates). Since the access predicates restrict the&lt;/P&gt;&lt;P&gt;number of pages to be read they minimize i/o. The filter pages do not restict the number of&lt;/P&gt;&lt;P&gt;pages to be read (not minimizing i/o) but they do restrict the amount of data that is sent&lt;/P&gt;&lt;P&gt;from the db to the application server where your ABAP program runs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Does it influence anything when creating an index?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hm... what do you mean by this question? The access and filter predicates just show you&lt;/P&gt;&lt;P&gt;how your where condition is applied on index and/or table blocks...  only for existing indexes &lt;/P&gt;&lt;P&gt;and tables only, of course. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; When you create an index, does the order of the column/field matters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes it does. In general put these cloumns that are used with EQUAL (=) or IN ( which could&lt;/P&gt;&lt;P&gt;be seen as a concatenated or iterated equal / = ) operator, at the beginning of an index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The classic phone book example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An index is created on LASTNAME, FIRSTNAME, STREET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This indexes can support the following where conditions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where lastname = ? and firstname = ?&lt;/P&gt;&lt;P&gt;where lastname = ?&lt;/P&gt;&lt;P&gt;where lastname = ? and street = ?&lt;/P&gt;&lt;P&gt;where lastname = ? and firstname =? and street = ?&lt;/P&gt;&lt;P&gt;(and others with ranges, between, like, ......)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you would have created the index in a different order: &lt;/P&gt;&lt;P&gt;e.g. FIRSTNAME, LASTNAME, STREET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these 2 where conditions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where lastname = ?&lt;/P&gt;&lt;P&gt;where lastname = ? and street = ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;would NOT be supported by this index since they are missing&lt;/P&gt;&lt;P&gt;the fistname which is the first field in the street.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for your frequently executed sql statements put those fields in&lt;/P&gt;&lt;P&gt;the beginning of the index which are used regular with equal (=) or IN condition&lt;/P&gt;&lt;P&gt;(and which are slective of course).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 18:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531590#M1263732</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-04-30T18:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531591#M1263733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the second question: yes the order of columns does matter both during creation and usage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2009 18:29:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531591#M1263733</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-04-30T18:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531592#M1263734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Order does matter and that's why we maintain order in WHERE clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 08:34:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531592#M1263734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T08:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531593#M1263735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Order does matter and that's why we maintain order in WHERE clause.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please don't mix things up. Order of fields does matter when an index is designed and created (see Hermann's answer), order of the fields in the WHERE-clause does &lt;EM&gt;not&lt;/EM&gt; matter reg. index usage, it might matter reg. program readability, but that's a different story.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 08:51:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531593#M1263735</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-05-05T08:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531594#M1263736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the order of the field in the WHERE-clause does not influence the decision which index is used.&lt;/P&gt;&lt;P&gt;Everybody you thinks differently should think about, how he would design a design logic,&lt;/P&gt;&lt;P&gt;only a simple one following the order of WHERE-clause or trying different orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the order of the fields in the index is essential, it is like a printed telephone book, a new order is a different book.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the statements are stored, to used the same processing later again, the decision which index to use can take longer than a simple SELECT SINGLE. To find the stored statement again, the WHERE condition should have the same order, otherwise this cache becomes larger and slower. That is the effect of the order of the fields in the WHERE-condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 09:00:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531594#M1263736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T09:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531595#M1263737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi Expert,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Got a few questions here.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; 1. What does access predicates and filter predicates in ST05/Performance trace means? Does it influence anything when creating an index?&lt;/P&gt;&lt;P&gt;&amp;gt; 2. When you create an index, does the order of the column/field matters?&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Thanks in advance.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Eida,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. good statements made by others&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.  Index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;creation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it comes to design an index you have to KNOW the queries that your application will fire to the table.&lt;/P&gt;&lt;P&gt;There is no general rule except that the index should fit with the access pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe your app would have a lot of queries of these types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from tab where col1 = x and col2 = y&lt;/P&gt;&lt;P&gt;select * from tab where col2 = y&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it would make sense to order the index keys that way: (COL2,COL1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;discriminating myth: "You should set the most discriminating index column in front ."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COL1: 10000000&lt;/P&gt;&lt;P&gt;COL2:   1000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myth suggested order: (COL1, COL2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you consider the columns C1 and C2 as vectors and have to compare them togehther in a WHERE it doesn't matter which comes first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore,  techniques like index key compression imply that you put the least discriminant in front&lt;/P&gt;&lt;P&gt;to get a good compression factor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 13:28:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531595#M1263737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T13:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531596#M1263738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..use the fileds in order how it is there in the Table or use the order of the index created..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check in DB05 transaction which Index is using..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 13:39:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531596#M1263738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T13:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531597#M1263739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yukonkid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;Furthermore, techniques like index key compression imply that you put the least discriminant in &lt;/P&gt;&lt;P&gt;&amp;gt; front to get a good compression factor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;indeed. That's another good argument why order of index fields should not be based on nr. of distinct keys only... . Thank you. I never thought of this in this combination so far &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 15:20:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531597#M1263739</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-05-05T15:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531598#M1263740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;readability is another reason why we should use one order in where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as well as different cursors in statement caches (for different sql strings)&lt;/P&gt;&lt;P&gt;as well as behaviour in st05 regarding identical selects ... all of them are reasons&lt;/P&gt;&lt;P&gt;for trying to use one specific order (e.g. like defined in ddic) of fields in where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cursor cache:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attached 3 sql statements are 3 different statements regarding their strings.&lt;/P&gt;&lt;P&gt;3 times prepare in st05. So they will be processed in 3 different cursors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The db optimizer will come up with the SAME execution plan for all 3 statements &lt;/P&gt;&lt;P&gt;and use CPU time for 3 times parsing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These execution plans will  allocate space for 3 statements in the cursor cache&lt;/P&gt;&lt;P&gt;and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;st05:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the attached 3 sql statements are technically different ST05 shows no&lt;/P&gt;&lt;P&gt;identical selects. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we would have used only one order for the field list we would have saved some&lt;/P&gt;&lt;P&gt;ressources on db and we would have seen that the selects are identical in ST05...&lt;/P&gt;&lt;P&gt;and yes... the ABAP program would be nicer regarding readability.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  select msgnr arbgb sprsl
  from t100 BYPASSING BUFFER
  into CORRESPONDING FIELDS OF t100
  where
  msgnr = '010' and
  arbgb = 'something' and
  sprsl = 'DE'.

  ENDSELECT.

  select msgnr arbgb sprsl
  from t100 BYPASSING BUFFER
  into CORRESPONDING FIELDS OF t100
  where
  arbgb = 'something' and
  msgnr = '010' and
  sprsl = 'DE'.

  ENDSELECT.

    select msgnr arbgb sprsl
  from t100 BYPASSING BUFFER
  into CORRESPONDING FIELDS OF t100
  where
  sprsl = 'DE' and
  msgnr = '010' and
  arbgb = 'something'.

  ENDSELECT.


      499 T100       PREPARE            0 SELECT WHERE "MSGNR" = :A0 AND "ARBGB" = :A1 AND "SPRSL" = :A2
        5 T100       OPEN               0 SELECT WHERE "MSGNR" = '010' AND "ARBGB" = 'something' AND "SPRSL" = 'D'
   10.638 T100       FETCH       0   1403
      448 T100       PREPARE            0 SELECT WHERE "ARBGB" = :A0 AND "MSGNR" = :A1 AND "SPRSL" = :A2
        5 T100       OPEN               0 SELECT WHERE "ARBGB" = 'something' AND "MSGNR" = '010' AND "SPRSL" = 'D'
    1.594 T100       FETCH       0   1403
      462 T100       PREPARE            0 SELECT WHERE "SPRSL" = :A0 AND "MSGNR" = :A1 AND "ARBGB" = :A2
        5 T100       OPEN               0 SELECT WHERE "SPRSL" = 'D' AND "MSGNR" = '010' AND "ARBGB" = 'something'
    1.793 T100       FETCH       0   1403

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 15:38:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531598#M1263740</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-05-05T15:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531599#M1263741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand the argument about the unnecessary parsing of SQL statements, but I would like to know, what effect does this have on the overall performance of a typical SAP installation? I assume much less than 1%? (comparing systems where this coding rule is being followed and those where it's not)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 16:05:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531599#M1263741</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-05-05T16:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531600#M1263742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think it it could be neglected, since repeated executions will reuse the cursors.&lt;/P&gt;&lt;P&gt;Todays SQL statement caches are rather big as well. But it is not so long ago&lt;/P&gt;&lt;P&gt;when they were in the range of Megabytes (not Gigabytes like today). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When there is a low hitratio on the statement cache (due to a small size) and or&lt;/P&gt;&lt;P&gt;a high number of different sql statements it maybe leads to a little overhead&lt;/P&gt;&lt;P&gt;on cpu usage due to parsing. And if we have to regularly prepare the execution plan&lt;/P&gt;&lt;P&gt;again and again (due to low hitratio in the cache) it would affect also execution&lt;/P&gt;&lt;P&gt;time of the statement. This would be a rather rare case i think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far (last 10 years), i never came across that this "issue" played an important  or&lt;/P&gt;&lt;P&gt;significant role... . I think it is nice to have... as long as we don't have really small statenent&lt;/P&gt;&lt;P&gt;caches and low hitratios on them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course I'm only talking about regular OPEN SQL &lt;/P&gt;&lt;P&gt;which is not using HINTS like &amp;amp;SUBSTITUTE VALUES&amp;amp; in a LOOP or something &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Hermann Gahm on May 5, 2009 6:24 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 16:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531600#M1263742</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-05-05T16:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531601#M1263743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hermann, many thanks for these clarifications.&lt;/P&gt;&lt;P&gt;Another example where a simple question turns into an interesting discussion, only the original poster was never seen again... &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Good night&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531601#M1263743</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-05-05T19:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531602#M1263744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the post. I'm still digesting all the inputs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531602#M1263744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T19:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531603#M1263745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just another comment.... :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i remember right... you work mostly on ORACLE.&lt;/P&gt;&lt;P&gt;For ORACLE 10g you can run the following SELECT &lt;/P&gt;&lt;P&gt;(in the ABAP Report RSORADJV for example):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT
    stat_name,
    round(value/1000000) time_waited_sec
FROM
    v$sys_time_model
WHERE stat_name LIKE 'DB%' 
OR    stat_name LIKE '%parse%' 
ORDER BY time_waited_sec desc
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will get an output like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
STAT_NAME                                        TIME_WAITED_SEC

DB time                                          10928573
DB CPU                                           5810338
parse time elapsed                               44891
hard parse elapsed time                          32916
failed parse elapsed time                        497
hard parse (sharing criteria) elapsed time       380
hard parse (bind mismatch) elapsed time          47
failed parse (out of shared memory) elapsed time 0
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all times are in seconds. &lt;/P&gt;&lt;P&gt;Now you can see how much time is needed for parsing.&lt;/P&gt;&lt;P&gt;You can see as well how much CPU time (in total) is used.&lt;/P&gt;&lt;P&gt;This time includes parsing... and recursive sql and scanning&lt;/P&gt;&lt;P&gt;the buffer cache and latches and and... . And you get the total db time&lt;/P&gt;&lt;P&gt;this time includes DB CPU + i/o + time for enque + everything else&lt;/P&gt;&lt;P&gt;for what db consumes time with... . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see how big the influence of parsing is with respect&lt;/P&gt;&lt;P&gt;to DB time and DB CPU time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have time... &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt; ... you can then order all your field lists and&lt;/P&gt;&lt;P&gt;where conditions... run the query again... and see if parsetimes&lt;/P&gt;&lt;P&gt;decrease (what should be the case). But I can't promise you if&lt;/P&gt;&lt;P&gt;you would FEEL a difference in overall DB performance... &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And btw: As a rule of thumb we assume that in a well tuned system&lt;/P&gt;&lt;P&gt;DB CPU time is 40 % of DB time.... if it is less... we assume that&lt;/P&gt;&lt;P&gt;there is still improvement potential regarding SQL tuning... indexes... &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and just another adition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT * 
FROM
V$SGASTAT
WHERE
name = 'sql area' 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shows you how big your sql area is inside the shared pool is. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The hitratios can be seen on the main screen in ST04:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Shared Pool
...
SQL Area getratio  %          100,0
         pinratio  %          100,0
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Hermann Gahm on May 6, 2009 8:46 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 06:42:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531603#M1263745</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-05-06T06:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531604#M1263746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; ABAP Report RSORADJV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;very interesting, many thanks.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;gt; If you have time... &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt; ... you can then order all your field lists and&lt;/P&gt;&lt;P&gt;&amp;gt; where conditions...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you guessed it, not enough time, let alone the administrational effort of moving code changes to production... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; And btw: As a rule of thumb we assume that in a well tuned system&lt;/P&gt;&lt;P&gt;&amp;gt; DB CPU time is 40 % of DB time.... if it is less... we assume that&lt;/P&gt;&lt;P&gt;&amp;gt; there is still improvement potential regarding SQL tuning... indexes... &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;36% here, I'll have a look...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 09:10:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531604#M1263746</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-05-06T09:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531605#M1263747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;don't nail down the 40 %... your 36 % ... to me sounds already like a well tuned system... &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If you would have said... 10 % CPU... i would recommend sql cache and wait event analysis...&lt;/P&gt;&lt;P&gt;but 36 % is quite ok i would say...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 11:27:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531605#M1263747</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-05-06T11:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531606#M1263748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@YukonKid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; discriminating myth: "You should set the most discriminating index column in front ."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; COL1: 10000000&lt;/P&gt;&lt;P&gt;&amp;gt; COL2: 1000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; myth suggested order: (COL1, COL2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; If you consider the columns C1 and C2 as vectors and have to compare them togehther in &lt;/P&gt;&lt;P&gt;&amp;gt; a WHERE it doesn't matter which comes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry, I am not convinced! The actual execution is never an issue, it is using the complete correct data. But optimizer decides which path to use based on assumptions, and there a good index design matters!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plus your example is simply not good, we are not BW, the numbers are much smaller!&lt;/P&gt;&lt;P&gt;The question is the following, not huge and nearly huge, but huge and medium &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COL1: 10.000.000&lt;/P&gt;&lt;P&gt;COL2: 10.000 or 1.000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 08:09:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531606#M1263748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-08T08:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531607#M1263749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; I understand the argument about the unnecessary parsing of SQL statements, but I would like to&lt;/P&gt;&lt;P&gt;&amp;gt; know, what effect does this have on the overall performance of a typical SAP installation? I assume&lt;/P&gt;&lt;P&gt;&amp;gt; much less than 1%? (comparing systems where this coding rule is being followed and those where it's &amp;gt; not)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the 1% is probably correct, if you count the parsing of all duplicate statements in the cursor cache and&lt;/P&gt;&lt;P&gt;compare them with all DB executions .... this must be much much less than 1%. But  is this really interesting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one argument which is sufficient for me, the statictics of the cursor cache. If statements which are in principle identical a spread over different entries, the I get no good overview on the DB performance. Maybe there is statement with problems which has 10 WHERE-conditions, then it can be distributed over ten or more entries and it will not be the top line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 08:17:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531607#M1263749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-08T08:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: ST05</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531608#M1263750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; And btw: As a rule of thumb we assume that in a well tuned system&lt;/P&gt;&lt;P&gt;&amp;gt; DB CPU time is 40 % of DB time.... if it is less... we assume that&lt;/P&gt;&lt;P&gt;&amp;gt; there is still improvement potential regarding SQL tuning... indexes... &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;less is better, even with percentages ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't like these overall percentages too much, they are good for the tuning of a whole system.&lt;/P&gt;&lt;P&gt;People here look at particular applications, and there is no general rule for DB-percentages.&lt;/P&gt;&lt;P&gt;Check the standard benchmarks they a range start from 20%.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 08:26:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/st05/m-p/5531608#M1263750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-08T08:26:13Z</dc:date>
    </item>
  </channel>
</rss>

