<?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: Select Join Performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625673#M1570732</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know if anyone has already suggested something like this but it might be worth trying to split the select&lt;/P&gt;&lt;P&gt;like the following to get the key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ebeln  ebelp&lt;/P&gt;&lt;P&gt;           INTO CORRESPONDING FIELDS OF TABLE g_ekpo_keys "sorted on ebeln ebelp&lt;/P&gt;&lt;P&gt;           FROM    ekpo &lt;/P&gt;&lt;P&gt;           WHERE matnr IN s_matnr  AND&lt;/P&gt;&lt;P&gt;                 werks IN s_werks  AND&lt;/P&gt;&lt;P&gt;                 bstyp IN s_bstyp  AND&lt;/P&gt;&lt;P&gt;                 loekz =  space    AND&lt;/P&gt;&lt;P&gt;                 elikz IN r_elikz  AND&lt;/P&gt;&lt;P&gt;                 matkl IN s_matkl  AND&lt;/P&gt;&lt;P&gt;                 pstyp IN s_pstyp  AND&lt;/P&gt;&lt;P&gt;                 knttp IN s_knttp  AND&lt;/P&gt;&lt;P&gt;                 kanba  'Y'      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if g_ekpo_keys is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT k&lt;SUB&gt;ebeln  k&lt;/SUB&gt;lifnr  k&lt;SUB&gt;ekgrp  k&lt;/SUB&gt;ekorg  k&lt;SUB&gt;bukrs  k&lt;/SUB&gt;bsart&lt;/P&gt;&lt;P&gt;           k&lt;SUB&gt;bstyp  k&lt;/SUB&gt;bedat  k&lt;SUB&gt;reswk  k&lt;/SUB&gt;spras  k~adrnr&lt;/P&gt;&lt;P&gt;           k&lt;SUB&gt;waers p&lt;/SUB&gt;ebelp  p&lt;SUB&gt;pstyp  p&lt;/SUB&gt;werks  p&lt;SUB&gt;matnr  p&lt;/SUB&gt;matkl  p~txz01&lt;/P&gt;&lt;P&gt;           p&lt;SUB&gt;idnlf  p&lt;/SUB&gt;labnr&lt;/P&gt;&lt;P&gt;           p&lt;SUB&gt;elikz  p&lt;/SUB&gt;erekz  p&lt;SUB&gt;knttp  p&lt;/SUB&gt;vrtkz  p&lt;SUB&gt;meins  p&lt;/SUB&gt;mfrpn&lt;/P&gt;&lt;P&gt;            p&lt;SUB&gt;effwr p&lt;/SUB&gt;netpr p&lt;SUB&gt;peinh p&lt;/SUB&gt;bprme&lt;/P&gt;&lt;P&gt;           t&lt;SUB&gt;etenr  t&lt;/SUB&gt;eindt  t&lt;SUB&gt;menge  t&lt;/SUB&gt;wemng  t&lt;SUB&gt;slfdt  t&lt;/SUB&gt;mahnz&lt;/P&gt;&lt;P&gt;           INTO CORRESPONDING FIELDS OF TABLE g_i_tab1&lt;/P&gt;&lt;P&gt;           FROM  ekpo    AS p&lt;/P&gt;&lt;P&gt;           JOIN  ekko    AS k&lt;/P&gt;&lt;P&gt;           ON    k&lt;SUB&gt;ebeln =  p&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;           JOIN  eket    AS t&lt;/P&gt;&lt;P&gt;           ON    t&lt;SUB&gt;ebeln =  p&lt;/SUB&gt;ebeln  AND&lt;/P&gt;&lt;P&gt;                 t&lt;SUB&gt;ebelp =  p&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;           for all entries in g_ekpo_keys&lt;/P&gt;&lt;P&gt;           WHERE p~ebeln = g_ekpo_keys-ebeln and&lt;/P&gt;&lt;P&gt;                 p&lt;SUB&gt;ebelp = g_ekpo_keys&lt;/SUB&gt;ebelp and &lt;/P&gt;&lt;P&gt;                 k~lifnr IN s_lifnr  AND&lt;/P&gt;&lt;P&gt;                 k~ekorg IN s_ekorg  AND&lt;/P&gt;&lt;P&gt;                 k~ekgrp IN s_ekgrp  AND&lt;/P&gt;&lt;P&gt;                 k~bedat IN s_bedat  AND&lt;/P&gt;&lt;P&gt;                 k~ebeln IN s_ebeln  AND&lt;/P&gt;&lt;P&gt;                 k~bstyp IN s_bstyp  AND&lt;/P&gt;&lt;P&gt;                 k~bsart IN s_bsart  AND&lt;/P&gt;&lt;P&gt;                 k~loekz =  space    AND&lt;/P&gt;&lt;P&gt;                 t~eindt IN s_eindt  AND&lt;/P&gt;&lt;P&gt;                 t~menge &amp;gt;  0        AND&lt;/P&gt;&lt;P&gt;                 t&lt;SUB&gt;menge &amp;gt;  t&lt;/SUB&gt;wemng.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Feb 2011 23:31:55 GMT</pubDate>
    <dc:creator>former_member186741</dc:creator>
    <dc:date>2011-02-13T23:31:55Z</dc:date>
    <item>
      <title>Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625642#M1570701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a performance problem with this select statement: Takes 30 to 50 secs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    SELECT k~ebeln  k~lifnr  k~ekgrp  k~ekorg  k~bukrs  k~bsart
           k~bstyp  k~bedat  k~reswk  k~spras  k~adrnr
           k~waers p~ebelp  p~pstyp  p~werks  p~matnr  p~matkl  p~txz01
           p~idnlf  p~labnr
           p~elikz  p~erekz  p~knttp  p~vrtkz  p~meins  p~mfrpn
            p~effwr p~netpr p~peinh p~bprme
           t~etenr  t~eindt  t~menge  t~wemng  t~slfdt  t~mahnz
           INTO CORRESPONDING FIELDS OF TABLE g_i_tab1
           FROM  ekko    AS k
           JOIN  ekpo    AS p
           ON    p~ebeln =  k~ebeln
           JOIN  eket    AS t
           ON    t~ebeln =  k~ebeln  AND
                 t~ebelp =  p~ebelp
           WHERE k~lifnr IN s_lifnr  AND
                 k~ekorg IN s_ekorg  AND
                 k~ekgrp IN s_ekgrp  AND
                 k~bedat IN s_bedat  AND
                 k~ebeln IN s_ebeln  AND
                 k~bstyp IN s_bstyp  AND
                 k~bsart IN s_bsart  AND
                 k~loekz =  space    AND
                 p~matnr IN s_matnr  AND
                 p~werks IN s_werks  AND
                 p~bstyp IN s_bstyp  AND
                 p~loekz =  space    AND
                 p~elikz IN r_elikz  AND
                 p~matkl IN s_matkl  AND
                 p~pstyp IN s_pstyp  AND
                 p~knttp IN s_knttp  AND
                 p~kanba &amp;lt;&amp;gt; 'Y'      AND
                 t~eindt IN s_eindt  AND
                 t~menge &amp;gt;  0        AND
                 t~menge &amp;gt;  t~wemng.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SQL-Trace (ST05) shows two nested loops, the selection starts always with EKKO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder whether I can force the System to start the selection with Table EKPO, using a certain Index?&lt;/P&gt;&lt;P&gt;(When I count the number of entries with SE16N it takes only 1 sec and I should have the Unique Index to read the other two tables.)&lt;/P&gt;&lt;P&gt;What can I do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 16:41:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625642#M1570701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-08T16:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625643#M1570702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you indicate your  mandatory selection parameters? What is the index that it is currently hitting? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Vendor or BEDAT is filled, I would assume that your query always go after the respective indexes... If you can always ensure that Vendor, EKORG, EKGRP and BEDAT is populated, your query should be faster or BSTYP and BEDAT would give you good results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 17:01:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625643#M1570702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-08T17:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625644#M1570703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hints are DB specific. What is your DB type ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Oracle, I can give some suggestions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to do an SQL trace to catch the exact statement.&lt;/P&gt;&lt;P&gt;Put the statement in ST05 and use the "explain with hint" function to check the functionality.&lt;/P&gt;&lt;P&gt;Try to use as less as possible hints in a statement&lt;/P&gt;&lt;P&gt;For a join, you might want to use "leading(table-alias)" first to check if this is sufficiant.&lt;/P&gt;&lt;P&gt;That might look like "leading(k)" in your case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that is not good enough, you can give more hints like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
leading(k) index(k,"EKKO~Z01")
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suggest a nested loop of table EKPO utilizing the PK:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
leading(k) index(k,"EKKO~Z01") use_nl(k,p) index(p,"EKPO~0")
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more hints use google to find what is possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To bring it in Open SQL, you need to append&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HINTS ORACLE "Hint-Text"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to your ABAP statement. Validate in SQL Trace, that it is executed correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 18:36:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625644#M1570703</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2011-02-08T18:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625645#M1570704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
 WHERE k~lifnr IN s_lifnr  AND
                 k~ekorg IN s_ekorg  AND
                 k~ekgrp IN s_ekgrp  AND
                 k~bedat IN s_bedat  AND
                 k~ebeln IN s_ebeln  AND
                 k~bstyp IN s_bstyp  AND
                 k~bsart IN s_bsart  AND
                 k~loekz =  space    AND
                 p~matnr IN s_matnr  AND
                 p~werks IN s_werks  AND
                 p~bstyp IN s_bstyp  AND
                 p~loekz =  space    AND
                 p~elikz IN r_elikz  AND
                 p~matkl IN s_matkl  AND
                 p~pstyp IN s_pstyp  AND
                 p~knttp IN s_knttp  AND
                 p~kanba  'Y'      AND
                 t~eindt IN s_eindt  AND
                 t~menge &amp;gt;  0        AND
                 t~menge &amp;gt;  t~wemng.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is never understood in this forum, a SELECT like yours is dynamic ... the ranges are dynamic and usually only a few are filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All conditions for k =  ekko can be empty or all conditions for p = ekpo can be empty. So the starting table is not fixed.&lt;/P&gt;&lt;P&gt;Of course any other combination of conditions is possible. And not all combinations can be supported. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually the combinations, which make sense, are supported by indexes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your question should give the DB-statement which shows only the non-empty ranges!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hints can not help here!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 20:07:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625645#M1570704</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-08T20:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625646#M1570705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jens,&lt;/P&gt;&lt;P&gt;&lt;/P&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; What can I do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as the others said we need the data from ST05. How does your statement look like in the DB.&lt;/P&gt;&lt;P&gt;Additionally the execution plan and indexes might help as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On some databases (e.g. ORACLE and DB6)  you can control very detailed how the statement&lt;/P&gt;&lt;P&gt;should be executed. Other databases do not offer such a good control but more generic hints.&lt;/P&gt;&lt;P&gt;On the DB6 plattform we have conditional hints (check out SAP note 1484907). Having said that&lt;/P&gt;&lt;P&gt;i disagree with Siegfried that hints will not help here in general. With the conditional hints on DB6&lt;/P&gt;&lt;P&gt;it would be ok. I hope the conditional hints will follow for other DB plattforms. Without them you&lt;/P&gt;&lt;P&gt;would have to do this "conditional thing" yourself in ABAP which is dynamically possible as well&lt;/P&gt;&lt;P&gt;since a hint is just a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, hinting will help you only on &lt;U&gt;some&lt;/U&gt; plattforms. And then only for specific cases and&lt;/P&gt;&lt;P&gt;you have to be very precise and make sure you know what you do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gernerally you should find the root cause why your query is slow? Is the table with the smallest&lt;/P&gt;&lt;P&gt;result set processed as the first tabel? If not, why not? If better execution plans are available but&lt;/P&gt;&lt;P&gt;not picked up, get in contact with a DBA. They usually know the possible workarounds. Hinting&lt;/P&gt;&lt;P&gt;is one of them but there are others... .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want more help from this forum please post more details... execution plan, indexes, ... .&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, 08 Feb 2011 21:03:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625646#M1570705</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-02-08T21:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625647#M1570706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for your ansers so far. Hope this aditional information will help to find a good solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mandatory are only the following values:&lt;/P&gt;&lt;P&gt;EKPO-WERKS EKPO-ELIKZ EKET-EINDT&lt;/P&gt;&lt;P&gt;This values are fixed in the select statement:&lt;/P&gt;&lt;P&gt;EKPO-LOEKZ EKPO-KANBA EKET-MENGE EKET-WEMNG&lt;/P&gt;&lt;P&gt;Usually the selection is executed at lease with some of these valuels:&lt;/P&gt;&lt;P&gt;EKKO-BSTYP EKKO-LIFNR EKKO-EKGRP EKKO-EKORG EKPO-MATNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Database: ORACLE 10.2.0.4.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ST05 looks like this: (with EKKO-LIFNR -the mainly used selection)&lt;/P&gt;&lt;P&gt;SQL Statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;  T_00 . "EBELN" , T_00 . "LIFNR" , T_00 . "EKGRP" , T_00 . "EKORG" , T_00 . "BUKRS" ,&lt;/P&gt;&lt;P&gt;  T_00 . "BSART" , T_00 . "BSTYP" , T_00 . "BEDAT" , T_00 . "RESWK" , T_00 . "SPRAS" ,&lt;/P&gt;&lt;P&gt;  T_00 . "ADRNR" , T_00 . "WAERS" , T_01 . "EBELP" , T_01 . "PSTYP" , T_01 . "WERKS" ,&lt;/P&gt;&lt;P&gt;  T_01 . "MATNR" , T_01 . "MATKL" , T_01 . "TXZ01" , T_01 . "IDNLF" , T_01 . "LABNR" ,&lt;/P&gt;&lt;P&gt;  T_01 . "ELIKZ" , T_01 . "EREKZ" , T_01 . "KNTTP" , T_01 . "VRTKZ" , T_01 . "MEINS" ,&lt;/P&gt;&lt;P&gt;  T_01 . "MFRPN" , T_01 . "EFFWR" , T_01 . "NETPR" , T_01 . "PEINH" , T_01 . "BPRME" ,&lt;/P&gt;&lt;P&gt;  T_02 . "ETENR" , T_02 . "EINDT" , T_02 . "MENGE" , T_02 . "WEMNG" , T_02 . "SLFDT" ,&lt;/P&gt;&lt;P&gt;  T_02 . "MAHNZ"&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;  "EKKO" T_00 , "EKPO" T_01 , "EKET" T_02&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;  ( T_01 . "MANDT" = :A0 AND T_01 . "EBELN" = T_00 . "EBELN" ) AND ( T_02 . "MANDT" = :A1 AND T_02&lt;/P&gt;&lt;P&gt;  . "EBELN" = T_00 . "EBELN" AND T_02 . "EBELP" = T_01 . "EBELP" ) AND T_00 . "MANDT" = :A2 AND&lt;/P&gt;&lt;P&gt;  T_00 . "LIFNR" = :A3 AND T_00 . "EKORG" = :A4 AND T_00 . "BSTYP" IN ( :A5 , :A6 ) AND T_00 .&lt;/P&gt;&lt;P&gt;  "LOEKZ" = :A7 AND T_01 . "WERKS" = :A8 AND T_01 . "BSTYP" IN ( :A9 , :A10 ) AND T_01 . "LOEKZ" =&lt;/P&gt;&lt;P&gt;  :A11 AND T_01 . "ELIKZ" = :A12 AND T_01 . "KANBA" &amp;lt;&amp;gt; :A13 AND T_02 . "EINDT" BETWEEN :A14 AND&lt;/P&gt;&lt;P&gt;  :A15 AND T_02 . "MENGE" &amp;gt; :A16 AND T_02 . "MENGE" &amp;gt; T_02 . "WEMNG"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execution Plan&lt;/P&gt;&lt;P&gt; SELECT STATEMENT ( Estimated Costs = 19 , Estimated #Rows = 1 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        9 FILTER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            8 NESTED LOOPS&lt;/P&gt;&lt;P&gt;              ( Estim. Costs = 19 , Estim. #Rows = 1 )&lt;/P&gt;&lt;P&gt;              Estim. CPU-Costs = 171.394 Estim. IO-Costs = 19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                5 NESTED LOOPS&lt;/P&gt;&lt;P&gt;                  ( Estim. Costs = 15 , Estim. #Rows = 9 )&lt;/P&gt;&lt;P&gt;                  Estim. CPU-Costs = 135.184 Estim. IO-Costs = 15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                    2 TABLE ACCESS BY INDEX ROWID EKKO&lt;/P&gt;&lt;P&gt;                      ( Estim. Costs = 8 , Estim. #Rows = 9 )&lt;/P&gt;&lt;P&gt;                      Estim. CPU-Costs = 71.777 Estim. IO-Costs = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        1 INDEX RANGE SCAN EKKO~1&lt;/P&gt;&lt;P&gt;                          ( Estim. Costs = 1 , Estim. #Rows = 45 )&lt;/P&gt;&lt;P&gt;                          Search Columns: 3&lt;/P&gt;&lt;P&gt;                          Estim. CPU-Costs = 6.113 Estim. IO-Costs = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                    4 TABLE ACCESS BY INDEX ROWID EKET&lt;/P&gt;&lt;P&gt;                      ( Estim. Costs = 1 , Estim. #Rows = 1 )&lt;/P&gt;&lt;P&gt;                      Estim. CPU-Costs = 7.045 Estim. IO-Costs = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        3 INDEX RANGE SCAN EKET~0&lt;/P&gt;&lt;P&gt;                          Search Columns: 2&lt;/P&gt;&lt;P&gt;                          Estim. CPU-Costs = 3.339 Estim. IO-Costs = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                7 TABLE ACCESS BY INDEX ROWID EKPO&lt;/P&gt;&lt;P&gt;                  Estim. CPU-Costs = 4.023 Estim. IO-Costs = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                    6 INDEX UNIQUE SCAN EKPO~0&lt;/P&gt;&lt;P&gt;                      Search Columns: 3&lt;/P&gt;&lt;P&gt;                      Estim. CPU-Costs = 1.804 Estim. IO-Costs = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Used index: EKKO~1&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;LIFNR&lt;/P&gt;&lt;P&gt;EKORG&lt;/P&gt;&lt;P&gt;EKGRP&lt;/P&gt;&lt;P&gt;BEDAT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards &lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: jeman69 on Feb 9, 2011 10:22 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 09:21:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625647#M1570706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T09:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625648#M1570707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this selection &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;( T_01 . "MANDT" = :A0 AND T_01 . "EBELN" = T_00 . "EBELN" )&lt;/P&gt;&lt;P&gt; AND ( T_02 . "MANDT" = :A1 AND T_02 . "EBELN" = T_00 . "EBELN" AND T_02 . "EBELP" = T_01 . "EBELP" ) &lt;/P&gt;&lt;P&gt;AND T_00 . "MANDT" = :A2 &lt;/P&gt;&lt;P&gt;AND T_00 . "LIFNR" = :A3 &lt;/P&gt;&lt;P&gt;AND T_00 . "EKORG" = :A4 &lt;/P&gt;&lt;P&gt;AND T_00 . "BSTYP" IN ( :A5 , :A6 ) &lt;/P&gt;&lt;P&gt;AND T_00 ."LOEKZ" = :A7 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND T_01 . "WERKS" = :A8 &lt;/P&gt;&lt;P&gt;AND T_01 . "BSTYP" IN ( :A9 , :A10 ) &lt;/P&gt;&lt;P&gt;AND T_01 . "LOEKZ" = :A11 &lt;/P&gt;&lt;P&gt;AND T_01 . "ELIKZ" = :A12 &lt;/P&gt;&lt;P&gt;AND T_01 . "KANBA" :A13 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND T_02 . "EINDT" BETWEEN :A14 AND :A15 &lt;/P&gt;&lt;P&gt;AND T_02 . "MENGE" &amp;gt; :A16 &lt;/P&gt;&lt;P&gt;AND T_02 . "MENGE" &amp;gt; T_02 . "WEMNG"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;runs 50 seconds?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at first glance the execution plan (starting with lifnr) looks nice for me.&lt;/P&gt;&lt;P&gt;Have you checked if other options? it does not look like ekpo (T_01) would&lt;/P&gt;&lt;P&gt;be a better choice as a starting point in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check the result sets for all 3 tables in SE16 with the given selection&lt;/P&gt;&lt;P&gt;criteria. The optimizer should start on the smallest result set. This should be supported&lt;/P&gt;&lt;P&gt;by an index. If LIFNR provides the smalles result set and we have index suport here&lt;/P&gt;&lt;P&gt;the entry looks fine for me.&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, 09 Feb 2011 13:35:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625648#M1570707</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-02-09T13:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625649#M1570708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hermann,&lt;/P&gt;&lt;P&gt;Yes this runs depending on the Number of Purchase Orders and Sheduling Agreements too long.&lt;/P&gt;&lt;P&gt;LIFNR with 12.000 EKKO-Entries:  90s&lt;/P&gt;&lt;P&gt;LIFNR with 4.500 EKKO-Entries: 20s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I count the number of Entries of EKKO und EKPO using the selection criteria, I  get the following runtimes in SE16N:&lt;/P&gt;&lt;P&gt;EKKO with 4500 Entries: 8s (number differs from 0 to 12.000 depending on LIFNR)&lt;/P&gt;&lt;P&gt;EKPO with 6200 Entries: 4s (number is constant per plant)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total number of entries in the System:&lt;/P&gt;&lt;P&gt;EKKO: 450.000 &lt;/P&gt;&lt;P&gt;EKPO: 1.100.000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 16:30:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625649#M1570708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T16:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625650#M1570709</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;how does the plan change when you hint it with "leading(T_01)" in ST05 as your first suggestion was?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the stats up to date? The initial guess for the "~1" index entry is 35 rows,&lt;/P&gt;&lt;P&gt;which appears quite diffrent to the 4500 you mention as the reality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many rows do you get for a typical &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND T_02 . "EINDT" BETWEEN :A14 AND :A15 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on table EKET in SE16, and how long does that take?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 19:16:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625650#M1570709</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2011-02-09T19:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625651#M1570710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Yes this runs depending on the Number of Purchase Orders and Sheduling Agreements too long.&lt;/P&gt;&lt;P&gt;&amp;gt; LIFNR with 12.000 EKKO-Entries:  90s&lt;/P&gt;&lt;P&gt;&amp;gt; LIFNR with 4.500 EKKO-Entries: 20s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uneqal data distribution&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;gt; If I count the number of Entries of EKKO und EKPO using the selection criteria, I  get the following runtimes in SE16N:&lt;/P&gt;&lt;P&gt;&amp;gt; EKKO with 4500 Entries: 8s (number differs from 0 to 12.000 depending on LIFNR)&lt;/P&gt;&lt;P&gt;&amp;gt; EKPO with 6200 Entries: 4s (number is constant per plant)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;combined with a join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Challenging. For some LIFNRs the EKKO is the best entry (for those that have less rows than the other table result sets) and&lt;/P&gt;&lt;P&gt;for some EKKO is a suboptimal entry (for those that have more rows than the other table result sets). Theoretically histograms should help here but in this scenario i don't think it is a good option (depends of course).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can of course choose EKPO (or maybe EKET, see Volkers questions) as the default entry as a tradeoff. If they are rather constant it would be an good option for LIFNRs with a big result set. Only for LIFNRs with small result sets there would be better options (starting with EKKO available). You can make some tests with hints and LIFNRs with big and small volumes choosing EKKO or EKPO as the starting point and compare the run times.&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>Thu, 10 Feb 2011 06:25:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625651#M1570710</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-02-10T06:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625652#M1570711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Volker,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last statistiks date is 27.11.2010. (Should be OK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hint in ST05 seams to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL Statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;/*+&lt;/P&gt;&lt;P&gt;  leading(T_01)&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;  T_00 . "EBELN" , T_00 . "LIFNR" , T_00 . "EKGRP" , T_00 . "EKORG" , T_00 . "BUKRS" ,&lt;/P&gt;&lt;P&gt;  T_00 . "BSART" , T_00 . "BSTYP" , T_00 . "BEDAT" , T_00 . "RESWK" , T_00 . "SPRAS" ,&lt;/P&gt;&lt;P&gt;  T_00 . "ADRNR" , T_00 . "WAERS" , T_01 . "EBELP" , T_01 . "PSTYP" , T_01 . "WERKS" ,&lt;/P&gt;&lt;P&gt;  T_01 . "MATNR" , T_01 . "MATKL" , T_01 . "TXZ01" , T_01 . "IDNLF" , T_01 . "LABNR" ,&lt;/P&gt;&lt;P&gt;  T_01 . "ELIKZ" , T_01 . "EREKZ" , T_01 . "KNTTP" , T_01 . "VRTKZ" , T_01 . "MEINS" ,&lt;/P&gt;&lt;P&gt;  T_01 . "MFRPN" , T_01 . "EFFWR" , T_01 . "NETPR" , T_01 . "PEINH" , T_01 . "BPRME" ,&lt;/P&gt;&lt;P&gt;  T_02 . "ETENR" , T_02 . "EINDT" , T_02 . "MENGE" , T_02 . "WEMNG" , T_02 . "SLFDT" ,&lt;/P&gt;&lt;P&gt;  T_02 . "MAHNZ"&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;  "EKKO" T_00 , "EKPO" T_01 , "EKET" T_02&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;  ( T_01 . "MANDT" = :A0 AND T_01 . "EBELN" = T_00 . "EBELN" ) AND ( T_02 . "MANDT" = :A1 AND T_02&lt;/P&gt;&lt;P&gt;  . "EBELN" = T_00 . "EBELN" AND T_02 . "EBELP" = T_01 . "EBELP" ) AND T_00 . "MANDT" = :A2 AND&lt;/P&gt;&lt;P&gt;  T_00 . "LIFNR" = :A3 AND T_00 . "EKORG" = :A4 AND T_00 . "BSTYP" IN ( :A5 , :A6 ) AND T_00 .&lt;/P&gt;&lt;P&gt;  "LOEKZ" = :A7 AND T_01 . "WERKS" = :A8 AND T_01 . "BSTYP" IN ( :A9 , :A10 ) AND T_01 . "LOEKZ" =&lt;/P&gt;&lt;P&gt;  :A11 AND T_01 . "ELIKZ" = :A12 AND T_01 . "KANBA" &amp;lt;&amp;gt; :A13 AND T_02 . "EINDT" BETWEEN :A14 AND&lt;/P&gt;&lt;P&gt;  :A15 AND T_02 . "MENGE" &amp;gt; :A16 AND T_02 . "MENGE" &amp;gt; T_02 . "WEMNG"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execution Plan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT STATEMENT ( Estimated Costs = 4.445 , Estimated #Rows = 1 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        9 FILTER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            8 TABLE ACCESS BY INDEX ROWID EKET&lt;/P&gt;&lt;P&gt;              ( Estim. Costs = 1 , Estim. #Rows = 1 )&lt;/P&gt;&lt;P&gt;              Estim. CPU-Costs = 4.591 Estim. IO-Costs = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                7 NESTED LOOPS&lt;/P&gt;&lt;P&gt;                  ( Estim. Costs = 4.444 , Estim. #Rows = 1 )&lt;/P&gt;&lt;P&gt;                  Estim. CPU-Costs = 88.575.088 Estim. IO-Costs = 4.432&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      5 HASH JOIN&lt;/P&gt;&lt;P&gt;    ( Estim. Costs = 4.439 , Estim. #Rows = 9 )&lt;/P&gt;&lt;P&gt;    Estim. CPU-Costs = 88.533.765 Estim. IO-Costs = 4.427&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      2 TABLE ACCESS BY INDEX ROWID EKPO&lt;/P&gt;&lt;P&gt;      ( Estim. Costs = 4.430 , Estim. #Rows = 4.672 )&lt;/P&gt;&lt;P&gt;    Estim. CPU-Costs = 83.959.017 Estim. IO-Costs = 4.419&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                            1 INDEX SKIP SCAN EKPO~1&lt;/P&gt;&lt;P&gt;                              ( Estim. Costs = 1.983 , Estim. #Rows = 14.015 )&lt;/P&gt;&lt;P&gt;                              Search Columns: 4&lt;/P&gt;&lt;P&gt;                              Estim. CPU-Costs = 55.287.075 Estim. IO-Costs = 1.975&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                     4 TABLE ACCESS BY INDEX ROWID EKKO&lt;/P&gt;&lt;P&gt;                       ( Estim. Costs = 8 , Estim. #Rows = 9 )&lt;/P&gt;&lt;P&gt;                       Estim. CPU-Costs = 71.777 Estim. IO-Costs = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                         3 INDEX RANGE SCAN EKKO~1&lt;/P&gt;&lt;P&gt;                           ( Estim. Costs = 1 , Estim. #Rows = 45 )&lt;/P&gt;&lt;P&gt;                           Search Columns: 3&lt;/P&gt;&lt;P&gt;                           Estim. CPU-Costs = 6.113 Estim. IO-Costs = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                 6 INDEX RANGE SCAN EKET~0&lt;/P&gt;&lt;P&gt;                   Search Columns: 3&lt;/P&gt;&lt;P&gt;                   Estim. CPU-Costs = 3.059 Estim. IO-Costs = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although the estimates cost are very high I would like to test it.&lt;/P&gt;&lt;P&gt;How is the ABAP-Syntax for the Hint of the Select-Statement?&lt;/P&gt;&lt;P&gt;How do I get comparable results, since a second execution is always a lot faster ? &lt;/P&gt;&lt;P&gt;(Do I have to invalidate the Buffer for the tables? If so, how do I do this?)&lt;/P&gt;&lt;P&gt;Sorry for having so many questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typical  T_02 . "EINDT" BETWEEN :A14 AND :A15 &lt;/P&gt;&lt;P&gt;About 50.000 Entries, takes 14secs &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 09:58:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625652#M1570711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-10T09:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625653#M1570712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&amp;gt; Although the estimates cost are very high I would like to test it.&lt;/P&gt;&lt;P&gt;&amp;gt; How is the ABAP-Syntax for the Hint of the Select-Statement?&lt;/P&gt;&lt;P&gt;&amp;gt; How do I get comparable results, since a second execution is always a lot faster ? &lt;/P&gt;&lt;P&gt;&amp;gt; (Do I have to invalidate the Buffer for the tables? If so, how do I do this?)&lt;/P&gt;&lt;P&gt;&amp;gt; Sorry for having so many questions.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in ABAP you need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT k&lt;SUB&gt;ebeln  k&lt;/SUB&gt;lifnr  k&lt;SUB&gt;ekgrp  k&lt;/SUB&gt;ekorg  k&lt;SUB&gt;bukrs  k&lt;/SUB&gt;bsart&lt;/P&gt;&lt;P&gt;...           t&lt;SUB&gt;etenr  t&lt;/SUB&gt;eindt  t&lt;SUB&gt;menge  t&lt;/SUB&gt;wemng  t&lt;SUB&gt;slfdt  t&lt;/SUB&gt;mahnz&lt;/P&gt;&lt;P&gt;           INTO CORRESPONDING FIELDS OF TABLE g_i_tab1&lt;/P&gt;&lt;P&gt;           FROM  ekko    AS k&lt;/P&gt;&lt;P&gt;           JOIN  ekpo    AS p&lt;/P&gt;&lt;P&gt;           ON    p&lt;SUB&gt;ebeln =  k&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;           JOIN  eket    AS t&lt;/P&gt;&lt;P&gt;           ON    t&lt;SUB&gt;ebeln =  k&lt;/SUB&gt;ebeln  AND&lt;/P&gt;&lt;P&gt;                 t&lt;SUB&gt;ebelp =  p&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;           WHERE k~lifnr IN s_lifnr  AND&lt;/P&gt;&lt;P&gt;                 k~ekorg IN s_ekorg  AND&lt;/P&gt;&lt;P&gt;           ...                 t~menge &amp;gt;  0        AND&lt;/P&gt;&lt;P&gt;                 t&lt;SUB&gt;menge &amp;gt;  t&lt;/SUB&gt;wemng&lt;/P&gt;&lt;P&gt;%_hints ORACLE 'LEADING "EKPO"'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(or %_hints ORACLE 'LEADING "T_01"'.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;execute the queries multiple times and compare the buffergets per execution in ST04. In ORACLE you can reset the sql cache kpis after each test set (multiple executions) and analyze the delta since reset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try with and without hint for big and small LIFNRs.&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;Hemrann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 10:45:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625653#M1570712</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-02-10T10:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625654#M1570713</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;I do not think the skip scan entry for this plan will lead to anything.&lt;/P&gt;&lt;P&gt;So you have&lt;/P&gt;&lt;P&gt;EKKO with 4500 Entries: 8s (number differs from 0 to 12.000 depending on LIFNR)&lt;/P&gt;&lt;P&gt;EKPO with 6200 Entries: 4s (number is constant per plant)&lt;/P&gt;&lt;P&gt;EKET About 50.000 Entries, takes 14secs &lt;/P&gt;&lt;P&gt;this is 26 for counting in total&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... and a join delivering real fields takes 30 to 50 Secs&lt;/P&gt;&lt;P&gt;This does not sound all too bad taking the above 3 values into account&lt;/P&gt;&lt;P&gt;You did not say yet, how many rows the result has.&lt;/P&gt;&lt;P&gt;So to see, how many rows are eliminated in the join&lt;/P&gt;&lt;P&gt;Depending on that, one could try to change the join strategy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One could try to hint the join from "nested loop" to a "sort merge" or a "hash", just&lt;/P&gt;&lt;P&gt;to measure, if this gets any results, but I would do this in sqlplus with autotrace on&lt;/P&gt;&lt;P&gt;to get the additonal block statistic for the fetch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I do not think, this will give you better results as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 17:48:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625654#M1570713</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2011-02-10T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625655#M1570714</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;wrote a test-programm containing only the select-statement with and without hint.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; %_hints ORACLE 'leading(T_00) index(T_00,"EKPO~1")'. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Hint is working, as I can see in ST05.&lt;/P&gt;&lt;P&gt;Performance without hint is better than with hint.(2-3 times)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Executed the the Report a number of times (with hint):&lt;/P&gt;&lt;P&gt;First execution: 60sec&lt;/P&gt;&lt;P&gt;Following executions: 0.6sec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Executed the the Report a number of times (without hint):&lt;/P&gt;&lt;P&gt;First execution: 30sec&lt;/P&gt;&lt;P&gt;Following executions: 0.2sec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ST04 shows, that in the following executions data is read from database data buffer. (No physical reads)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the data were alway be in the database buffer the runtime would be perfect.&lt;/P&gt;&lt;P&gt;How can I do this, or is this against all principals?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not have direct acess to the ORACLE database. (Only via SAP)&lt;/P&gt;&lt;P&gt;Can I delete the database cache so that I can retest the excution time for the first execution?&lt;/P&gt;&lt;P&gt;Side effects?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thypically the select results in 10 to 100 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more Question:&lt;/P&gt;&lt;P&gt;In the development system ST05 - Execution plan contains a HASH JOIN.&lt;/P&gt;&lt;P&gt;In the integration system ST05 - Execution plan contains a NESTED LOOPS instead.&lt;/P&gt;&lt;P&gt;What does the ABAP-Syntax look like to hint the Database to perform NESTED LOOPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jens Grimmelmann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 11:20:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625655#M1570714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-11T11:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625656#M1570715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Performance without hint is better than with hint.(2-3 times)&lt;/P&gt;&lt;P&gt;as Volker said the original plan starting with LIFNR is probably a quite good one &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; If the data were alway be in the database buffer the runtime would be perfect.&lt;/P&gt;&lt;P&gt;&amp;gt; How can I do this, or is this against all principals?&lt;/P&gt;&lt;P&gt;i would not do it. We see that customers do this from time to time (on ORACLE you&lt;/P&gt;&lt;P&gt;have to create a so called KEEP POOL and put your table there, in case you are&lt;/P&gt;&lt;P&gt;interested just google with key words ORACLE KEEP POOL). It would mean&lt;/P&gt;&lt;P&gt;to place all table/index blocks in a dedicated pool with enough space so that &lt;/P&gt;&lt;P&gt;there is a high chance that no displacement will take place. It's a rather drastic&lt;/P&gt;&lt;P&gt;measure. You put away a siginificant part of the db cahe to support a certain&lt;/P&gt;&lt;P&gt;set of sql statements that could mean all other statements may suffer because&lt;/P&gt;&lt;P&gt;they have less cache available. Our recommendation typically is to stic to the&lt;/P&gt;&lt;P&gt;default pool and let ORACLE do the discplacement based on the touch count&lt;/P&gt;&lt;P&gt;in order to achieve a good performance for the whole system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I do not have direct acess to the ORACLE database. (Only via SAP)&lt;/P&gt;&lt;P&gt;&amp;gt; Can I delete the database cache so that I can retest the excution time for the first execution?&lt;/P&gt;&lt;P&gt;alter system flush db cache or something like that.... i would use it only&lt;/P&gt;&lt;P&gt;for test purposes...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Side effects?&lt;/P&gt;&lt;P&gt;nothing is in the cache... like after restarting the database... performance will be&lt;/P&gt;&lt;P&gt;bad for the whole system till the cache is filled again...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; One more Question:&lt;/P&gt;&lt;P&gt;&amp;gt; In the development system ST05 - Execution plan contains a HASH JOIN.&lt;/P&gt;&lt;P&gt;&amp;gt; In the integration system ST05 - Execution plan contains a NESTED LOOPS instead.&lt;/P&gt;&lt;P&gt;&amp;gt; What does the ABAP-Syntax look like to hint the Database to perform NESTED LOOPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The appropriate hint would be e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
%_hints ORACLE 'leading(T_00) index(T_00,"EKPO~1") use_nl(T_01)'. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this example you specified to start with t_00 on index ekpo~1 and then use a&lt;/P&gt;&lt;P&gt;nested loop join (use_nl) to approach table t_01 (oracle decides the access path for&lt;/P&gt;&lt;P&gt;this table).  you could continue with use_nl(T_02) to specify how the third table&lt;/P&gt;&lt;P&gt;should be joined. use_hash forces oracle to use a hash join if technically possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How much I/O is your query doing (buffer gets per exec)? If nothing is in cache&lt;/P&gt;&lt;P&gt;you can expect that each buffer get will be a disk read lasting for 6 - 15 ms (depending&lt;/P&gt;&lt;P&gt;on the i/O system) so you can calculate the expected time. Minimizing the i/O is the&lt;/P&gt;&lt;P&gt;only solution... if the i/O is already at a minimum... well...&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>Fri, 11 Feb 2011 12:03:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625656#M1570715</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-02-11T12:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625657#M1570716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; The appropriate hint would be e.g.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;
&amp;gt; %_hints ORACLE 'leading(T_00) index(T_00,"EKPO~1") use_nl(T_01)'. 
&amp;gt; &lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well the problem is, that you have only "leading" and "ordered" as hints for join order.&lt;/P&gt;&lt;P&gt;so even with that hint, it only suggests to start with EKKO and to use a nested loop&lt;/P&gt;&lt;P&gt;to EKPO, but it will not say WHEN, so it might be that with this hint you'll get right the original plan,&lt;/P&gt;&lt;P&gt;joining EKET at second position.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to make sure, that  EKPO is joined on position 2, you need to specify the sequence&lt;/P&gt;&lt;P&gt;in the FROM clause and use the "ordered" hint. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
%_hints ORACLE 'ordered'. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(With "ordered" meaning to access the tables in the sequence they follow in FROM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd not specify more at first (crosscheck in ST05), right because of the difference you notice &lt;/P&gt;&lt;P&gt;in hash vs. nested_loop. It might be, that for one system hash is better.  But if you want to do it anyway:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
2. try: %_hints ORACLE 'ordered use_nl(T_00,T_01)'. 
3. try: %_hints ORACLE 'ordered index(T_00,"EKKO~1") use_nl(T_00,T_01)'. 
4. try: %_hints ORACLE 'ordered index(T_00,"EKKO~1") use_nl(T_00,T_01) index(T_01,"EKPO~0")'. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I think you will not get away without indexing EKET on EINDAT in addition to the join fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just out of curiosity: how many rows full fill this?&lt;/P&gt;&lt;P&gt;T_02 . "MENGE" &amp;gt; T_02 . "WEMNG"&lt;/P&gt;&lt;P&gt;vs.&lt;/P&gt;&lt;P&gt;T_02 . "MENGE" = T_02 . "WEMNG"&lt;/P&gt;&lt;P&gt;vs.&lt;/P&gt;&lt;P&gt;T_02 . "MENGE" &amp;lt; T_02 . "WEMNG"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is the condition, that cuts down the rows, one can possibly try to stick that into a functionbased index that&lt;/P&gt;&lt;P&gt;allows it to query the already executed comparison instead of retrieving the rows nd do the comparrison every time&lt;/P&gt;&lt;P&gt;it is called. (Allthough I can not say how this access would have to be translated to ABAP for access).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that your code in a customer program or is that a part of standard coding?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 13:44:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625657#M1570716</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2011-02-11T13:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625658#M1570717</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;Data buffer reads per execution (ST04):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Example:(High number of Entries for EKKO-LIFNR)&lt;/P&gt;&lt;P&gt;26.000 (with hint)(BD is doing HASH JOIN)&lt;/P&gt;&lt;P&gt;35.000 (with hint incl. Nested Loops)&lt;/P&gt;&lt;P&gt;50.000 (without hint)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second Example: (Medium number of Entries for EKKO-LIFNR)&lt;/P&gt;&lt;P&gt;21.000 (with hint) (BD is doing HASH JOIN)&lt;/P&gt;&lt;P&gt;34.000 (with hint incl. Nested Loops)&lt;/P&gt;&lt;P&gt;26.000 (without hint)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Third Example: (Very low number of Entries for EKKO-LIFNR)&lt;/P&gt;&lt;P&gt;13.000 (with hint) (BD is doing HASH JOIN)&lt;/P&gt;&lt;P&gt;31.000 (with hint incl. Nested Loops)&lt;/P&gt;&lt;P&gt;500 (without hint)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Conclusion:&lt;/P&gt;&lt;P&gt;To force the Database to do a Nested Loop insead of a Hash join is a bad Idea.&lt;/P&gt;&lt;P&gt;To force the  database to start the selection with EKPO only in certaim cases sensible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seams that there is no solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 13:49:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625658#M1570717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-11T13:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625659#M1570718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Volker,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Well the problem is, that you have only "leading" and "ordered" as hints for join order.&lt;/P&gt;&lt;P&gt;&amp;gt; so even with that hint, it only suggests to start with EKKO and to use a nested loop&lt;/P&gt;&lt;P&gt;&amp;gt; to EKPO, but it will not say WHEN, so it might be that with this hint you'll get right the original plan,&lt;/P&gt;&lt;P&gt;&amp;gt; joining EKET at second position.&lt;/P&gt;&lt;P&gt;are you sure about that?&lt;/P&gt;&lt;P&gt;My understanding so far was that it should work. But I'm not too sure i must admit.&lt;/P&gt;&lt;P&gt;Looking at things like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/" target="test_blank"&gt;http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i got the impression it &lt;U&gt;should&lt;/U&gt; work this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; If you want to make sure, that  EKPO is joined on position 2, you need to specify the sequence&lt;/P&gt;&lt;P&gt;&amp;gt; in the FROM clause and use the "ordered" hint. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;agreed. "ordered" nails down the execution order for sure.&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;p.s.: i really like your engagement here, it's always interesting and enriching reading from you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 14:06:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625659#M1570718</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-02-11T14:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625660#M1570719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the runtimes do colerate with the buffer gets?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well the main problem is the unequal data distribution. Histograms were designed to help here.&lt;/P&gt;&lt;P&gt;But histograms in OLTP systems are... 'difficult' since you could produce many different sql&lt;/P&gt;&lt;P&gt;queries easily (one for each LIFNR)... . So i doubt it would be a good idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you have to find out a (one) plan that fits all more or less and hint the optimizer to execute it.&lt;/P&gt;&lt;P&gt;Looking at your figures: Hash join + hint is in all cases the 2nd best option regarding I/O.&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>Fri, 11 Feb 2011 14:17:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625660#M1570719</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-02-11T14:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select Join Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625661#M1570720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hermann,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no, I am not sure. I never did it diffrent becasue of this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/hintsref.htm" target="test_blank"&gt;http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/hintsref.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;16.1.2.4 Hints for Join Orders&lt;/P&gt;&lt;P&gt;16.1.2.5 Hints for Join Operations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JL is pretty good, so I guess he did a good research on that.&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 14:19:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-performance/m-p/7625661#M1570720</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2011-02-11T14:19:14Z</dc:date>
    </item>
  </channel>
</rss>

