<?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 Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870944#M930384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jayadeep - well, you're wrong about including key fields in the SELECT. I counted a number of them. But the SELECT is quite complex and the optimizer probably cannot determine the best index to use and just does a full table scan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try a couple of things:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove all non-key (primary and secondary) fields from the SELECT and filter data from the internal table afterwards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that works, fine; if not, analyze your range tables to determine which (if any are empty) and construct a number of SELECTs which only use one or two non-empty range tables in the WHERE. Try to use the best SELECT. Again, you have to filter after5wards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that works, fine; if not, run it in the background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 May 2008 19:49:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-17T19:49:59Z</dc:date>
    <item>
      <title>Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870939#M930379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to tune a select stmnt which was working fine in prod uptil a week age. Now this query is giving core dump. May be because of the increasing number of data in the prod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the query is like..&lt;/P&gt;&lt;P&gt;SELECT a~QMNUM&lt;/P&gt;&lt;P&gt;       a~objnr&lt;/P&gt;&lt;P&gt;       a~bstnk&lt;/P&gt;&lt;P&gt;       a~qmart&lt;/P&gt;&lt;P&gt;       a~KUNUM&lt;/P&gt;&lt;P&gt;       a~zztrjobnum&lt;/P&gt;&lt;P&gt;       a~QMTXT&lt;/P&gt;&lt;P&gt;       a~ADRNR&lt;/P&gt;&lt;P&gt;       a~zzoutcm&lt;/P&gt;&lt;P&gt;       a~ZZADDLWORK&lt;/P&gt;&lt;P&gt;       a~tplnr "change kk080&lt;/P&gt;&lt;P&gt;       a~btpln "addition RC232 E502860820&lt;/P&gt;&lt;P&gt;       a~erdat&lt;/P&gt;&lt;P&gt;       b~erdat&lt;/P&gt;&lt;P&gt;       b~erzeit&lt;/P&gt;&lt;P&gt;       a~strmn&lt;/P&gt;&lt;P&gt;       a~equnr&lt;/P&gt;&lt;P&gt;       a~bequi&lt;/P&gt;&lt;P&gt;       a~zzdisp_date&lt;/P&gt;&lt;P&gt;       a~zzdisp_time&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      a~zzmedsub&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       a~zzdlvstat&lt;/P&gt;&lt;P&gt;       a~ernam&lt;/P&gt;&lt;P&gt;       b~pster&lt;/P&gt;&lt;P&gt;       b~pstur&lt;/P&gt;&lt;P&gt;       b~mncod&lt;/P&gt;&lt;P&gt;       b~manum&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;appending corresponding fields of table ITAB&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INTO (ITAB-qmnum, itab-objnr, itab-bstnk, itab-qmart,&lt;/P&gt;&lt;P&gt;itab-kunum, itab-zztrjobnum, itab-qmtxt, itab-adrnr, itab-zzoutcm,&lt;/P&gt;&lt;P&gt;itab-zzaddlwork, itab-tplnr, itab-btpln, itab-erdat, itab-erdat1,&lt;/P&gt;&lt;P&gt;itab-erzeit1, itab-strmn, itab-equnr, itab-bequi, itab-dispdate,&lt;/P&gt;&lt;P&gt;itab-disptime, itab-zzdlvstat, itab-ernam, itab-pster, itab-pstur,&lt;/P&gt;&lt;P&gt;itab-mncod, itab-manum)&lt;/P&gt;&lt;P&gt; FROM VIQMEL as a inner join viqmma as b on a&lt;SUB&gt;qmnum = b&lt;/SUB&gt;qmnum&lt;/P&gt;&lt;P&gt; where b~mncod in ('9','9P','AD','BA','C001','C002','C003','C004',&lt;/P&gt;&lt;P&gt;                   'C005', 'CC', 'CM', 'CS', 'CT', 'FD', 'FM', 'FW',&lt;/P&gt;&lt;P&gt;                   'MR','N', 'NA','NR', 'SY', 'TI', 'TM', 'TP', 'WD',&lt;/P&gt;&lt;P&gt;                   'WS', 'FC', 'JC','PC','SC' )&lt;/P&gt;&lt;P&gt;  and ( b&lt;SUB&gt;mngrp eq 'STATUS' OR b&lt;/SUB&gt;mngrp eq 'I&amp;amp;CCOMP' or b~mngrp eq&lt;/P&gt;&lt;P&gt;'I&amp;amp;CPPM' )&lt;/P&gt;&lt;P&gt;  and b~kzloesch ne 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; and b~pster IN qmdab&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  and b~pstur in petur&lt;/P&gt;&lt;P&gt;  and a~zzoutcm in zzoutcm&lt;/P&gt;&lt;P&gt;  and a~ZZADDLWORK in ZZADDLWO&lt;/P&gt;&lt;P&gt;  AND a~qmart in qmart&lt;/P&gt;&lt;P&gt;  and a~qmtxt in qmtxt&lt;/P&gt;&lt;P&gt;  and a~qmnum in qmnum&lt;/P&gt;&lt;P&gt;  and a~tplnr in S_MPRN " Change kk080&lt;/P&gt;&lt;P&gt;  and a~btpln in s_Funloc " addition RC232 E502860820&lt;/P&gt;&lt;P&gt;  and a~erdat in erdat&lt;/P&gt;&lt;P&gt;  and b~erdat  in QMAERDAT&lt;/P&gt;&lt;P&gt;  and b~erzeit in QMAERZEI&lt;/P&gt;&lt;P&gt;  and a~strmn  in strmn&lt;/P&gt;&lt;P&gt;  and a~equnr in equnr&lt;/P&gt;&lt;P&gt;  and a~bequi in bequi&lt;/P&gt;&lt;P&gt;  and a~zzdisp_date in dispdate&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; and a~zzdisp_time in disptime&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  and a~zztrjobnum   in twmsjbno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the following things but failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. broke the join into two distinct select query like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*select qmnum&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      manum&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      mncod&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      erdat&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      pster&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      pstur&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      erzeit&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      into table itemp2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      from viqmma&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      where qmnum in QMNUM and&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      mngrp in r_mngrp and&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      mncod in r_mncod and&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      erdat  in QMAERDAT and&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      pstur in petur&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;       and  pster eq qmdab&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and erzeit in QMAERZEI&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and kzloesch NE 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*if not itemp2[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*SELECT qmnum&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      objnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      bstnk&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      qmart&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      kunum&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      zztrjobnum&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      qmtxt&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      adrnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      zzoutcm&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      zzaddlwork&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      tplnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      btpln&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      erdat&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      strmn&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      equnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      bequi&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      zzdisp_date&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      zzdisp_time&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      zzmedsub&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      zzdlvstat&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      ernam&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      into table itemp1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      from viqmel&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;      for all entries in itemp2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;      where qmnum EQ itemp2-qmnum&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      where qmnum EQ qmnum&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and zzoutcm in zzoutcm&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and zzaddlwork in zzaddlwo&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and qmart in qmart&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and qmtxt in qmtxt&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and qmnum in qmnum&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and tplnr in s_mprn&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and btpln in s_funloc&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and erdat in erdat&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and strmn in strmn&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and equnr in equnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and bequi in bequi&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and zzdisp_date in dispdate&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;      and zzdisp_time in zzdisp_time&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      and zztrjobnum in twmsjbno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still it is taking a lot of time getting executed as i have not included the key fields in the where clause condition. The reason being in the selection screen only the date and notification type is entered. So it is taking a lot of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I tried putting package size for the select wid the join condition. But that is not allowed as the data picked is not pulled into all the fields of the internal table. Some fields of the int table are being populated by other stmnts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So can anyone suggest a better way of running this query widout changing the input criteria given in it previuosly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jayadeep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 10:36:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870939#M930379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T10:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870940#M930380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not looking into details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But a FAE will not improve performance if you are actually missing indexes. If you have full table scans then you scan survive in test systems but not in productive systems. Without indexes nothing will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With proper indexes, a join is faster than the FAE (for all entries).&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, 16 May 2008 11:03:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870940#M930380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T11:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870941#M930381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the reason for the core dump? Check in ST22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is time out change your code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT ...
       FROM ... JOIN
       WHERE ...
       .
  APPEND ITAB.
ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; To:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT ...
       INTO corresponding fields of TABLE ITAB
       FROM ... JOIN
       WHERE ....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MattG.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 11:20:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870941#M930381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T11:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870942#M930382</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;avoid NE in your select (b~kzloesch ne 'X' ). It tends to neglect the index during data fetch.&lt;/P&gt;&lt;P&gt;and avoid OR condition too. Instead use IN condition for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;( b~mngrp eq 'STATUS' OR b~mngrp eq 'I&amp;amp;CCOMP' or b~mngrp eq
'I&amp;amp;CPPM' )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 11:36:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870942#M930382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T11:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870943#M930383</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 see this is very big an complex query and you can try following on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove corresponding fields and just define internal table in the same sequence of data selection fields in query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check where clause field sequence if it is hitting proper index on table. (if there's is no index on table, evaluate the possibility of creating one for this query)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont use append ITAB, instead you can select all the entries at one go in internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your query is in 'select..endselect', check is you can remove that from select.. endselect and keep in loop of another internal table or use for all entries.. This way you are saving database hits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define range for the field in your where clause IN ('X' 'Y'......)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thnx, Award points if you find this useful..&lt;/P&gt;&lt;P&gt;Ags..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2008 15:10:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870943#M930383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-17T15:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870944#M930384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jayadeep - well, you're wrong about including key fields in the SELECT. I counted a number of them. But the SELECT is quite complex and the optimizer probably cannot determine the best index to use and just does a full table scan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try a couple of things:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove all non-key (primary and secondary) fields from the SELECT and filter data from the internal table afterwards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that works, fine; if not, analyze your range tables to determine which (if any are empty) and construct a number of SELECTs which only use one or two non-empty range tables in the WHERE. Try to use the best SELECT. Again, you have to filter after5wards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that works, fine; if not, run it in the background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2008 19:49:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870944#M930384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-17T19:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870945#M930385</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;&lt;/P&gt;&lt;P&gt;Avoid the select..endselect statement since this will hit the database fetched.&lt;/P&gt;&lt;P&gt;Use Open cursor statements to package the fetches from DB.&lt;/P&gt;&lt;P&gt;Avoid For all entries since this will again increase the DB fetched&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shruthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 04:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3870945#M930385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T04:11:24Z</dc:date>
    </item>
  </channel>
</rss>

