<?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: Serious query optimization.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844158#M358412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the first place why do you want a unlimited loop...endloop.&lt;/P&gt;&lt;P&gt;Loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table IT_TABDD03L with key fieldname = IT_TABFIELDS-fieldname TABNAME = P_table.&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select query is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Jan 2007 16:57:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-31T16:57:14Z</dc:date>
    <item>
      <title>Serious query optimization..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844157#M358411</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 am facing a serious performance issue with a query. This query is fetching data definions of all the fields of a given table. Table /Insurance/DD02T  has short descriptions of the fields, and hence I am doing inner join between dd03l and /Insurance/DD02T   as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was using query :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop&lt;/P&gt;&lt;P&gt;select A&lt;SUB&gt;fieldname A&lt;/SUB&gt;datatype A&lt;SUB&gt;leng B&lt;/SUB&gt;DDTEXT into table IT_TABDD03L&lt;/P&gt;&lt;P&gt;       from DD03L AS A inner join /Insurance/DD02T  AS B&lt;/P&gt;&lt;P&gt;       on A&lt;SUB&gt;fieldname =  B&lt;/SUB&gt;fieldname&lt;/P&gt;&lt;P&gt;       AND A&lt;SUB&gt;TABNAME = B&lt;/SUB&gt;TABNAME&lt;/P&gt;&lt;P&gt;       where A~tabname = P_TABLE&lt;/P&gt;&lt;P&gt;       AND   B~DDLANGUAGE = 'EN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then read table with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table IT_TABDD03L with key fieldname = IT_TABFIELDS-fieldname.&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But using above select inside loop was not agood idea, so I used seelct outside loop and then used read statement inside loop as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select A&lt;SUB&gt;fieldname A&lt;/SUB&gt;datatype A&lt;SUB&gt;leng A&lt;/SUB&gt;tabname B~DDTEXT into table     &lt;/P&gt;&lt;P&gt;       IT_TABDD03L&lt;/P&gt;&lt;P&gt;       from DD03L AS A inner join /Insurance/DD02T  AS B&lt;/P&gt;&lt;P&gt;       on A&lt;SUB&gt;fieldname =  B&lt;/SUB&gt;fieldname&lt;/P&gt;&lt;P&gt;       AND A&lt;SUB&gt;TABNAME = B&lt;/SUB&gt;TABNAME&lt;/P&gt;&lt;P&gt;       where B~DDLANGUAGE = 'EN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table IT_TABDD03L with key fieldname = IT_TABFIELDS-fieldname TABNAME = P_table.&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this select is more horrible then previous one which I was using inside loop. Please help me to optimize this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 16:43:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844157#M358411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T16:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Serious query optimization..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844158#M358412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the first place why do you want a unlimited loop...endloop.&lt;/P&gt;&lt;P&gt;Loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table IT_TABDD03L with key fieldname = IT_TABFIELDS-fieldname TABNAME = P_table.&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select query is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 16:57:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844158#M358412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T16:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Serious query optimization..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844159#M358413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do a binary search:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort IT_TABDD03L by fieldname.
read table IT_TABDD03L with key 
  fieldname = IT_TABFIELDS-fieldname TABNAME = P_table
  binary search.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nested loops can be more of a performance problem that poorly coded SELECT statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 17:07:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844159#M358413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T17:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Serious query optimization..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844160#M358414</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;Have you looked FM DDIF_FIELDINFO_GET instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 17:15:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844160#M358414</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T17:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Serious query optimization..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844161#M358415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think you have done some mistake in the condition that you have given in the second select statement ,plz check that again and do the changes accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2007 18:13:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serious-query-optimization/m-p/1844161#M358415</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-31T18:13:34Z</dc:date>
    </item>
  </channel>
</rss>

