<?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 Does REDUCE perform better using sorted tables? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810768#M2025559</link>
    <description>&lt;P&gt;So, I'm using reduce to get the number of record that satisfy a condition inside a loop. &lt;/P&gt;
  &lt;P&gt;Will it perform better if the table is declared as sorted using a logic similar to that of parallel cursor or does it actually just check linearly?&lt;/P&gt;
  &lt;P&gt;The code is as follow.&lt;/P&gt;
  &lt;P&gt;DATA(sum) = REDUCE i( INIT x = 0 FOR wa IN lt_iloa WHERE ( tplnr = ls_ifl_list-tplnr ) NEXT x = x + 1 ).&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2023 09:35:27 GMT</pubDate>
    <dc:creator>matteo_pascon</dc:creator>
    <dc:date>2023-06-16T09:35:27Z</dc:date>
    <item>
      <title>Does REDUCE perform better using sorted tables?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810768#M2025559</link>
      <description>&lt;P&gt;So, I'm using reduce to get the number of record that satisfy a condition inside a loop. &lt;/P&gt;
  &lt;P&gt;Will it perform better if the table is declared as sorted using a logic similar to that of parallel cursor or does it actually just check linearly?&lt;/P&gt;
  &lt;P&gt;The code is as follow.&lt;/P&gt;
  &lt;P&gt;DATA(sum) = REDUCE i( INIT x = 0 FOR wa IN lt_iloa WHERE ( tplnr = ls_ifl_list-tplnr ) NEXT x = x + 1 ).&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 09:35:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810768#M2025559</guid>
      <dc:creator>matteo_pascon</dc:creator>
      <dc:date>2023-06-16T09:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Does REDUCE perform better using sorted tables?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810769#M2025560</link>
      <description>&lt;P&gt;Hi Matteo,&lt;/P&gt;&lt;P&gt;Yes, it will take the advantage of access by key on tplnr and will not run entire internal table. So the difference of execution can be huge and with a constant result time benefit from indexed access.&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Rós&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 12:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810769#M2025560</guid>
      <dc:creator>fedaros</dc:creator>
      <dc:date>2023-06-16T12:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Does REDUCE perform better using sorted tables?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810770#M2025561</link>
      <description>&lt;P&gt;Wonderful! Thanks for the insights.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 13:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810770#M2025561</guid>
      <dc:creator>matteo_pascon</dc:creator>
      <dc:date>2023-06-16T13:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Does REDUCE perform better using sorted tables?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810771#M2025562</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;matteo_pascon&lt;/SPAN&gt; as documented in ABAP documentation &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenfor_cond.htm"&gt;FOR, cond&lt;/A&gt; &amp;gt; "As with &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abaploop_at_itab_cond.htm"&gt;LOOP AT itab&lt;/A&gt;, the following is possible for each expression FOR ... IN itab" &amp;gt; &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abaploop_at_itab_cond.htm"&gt;LOOP AT itab, cond&lt;/A&gt; :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;"If the primary table key is specified using its name primary_key, the processing behaves in the same way as if no key were explicitly specified."&lt;/LI&gt;&lt;LI&gt;etc.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 16 Jun 2023 13:51:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810771#M2025562</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-06-16T13:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Does REDUCE perform better using sorted tables?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810772#M2025563</link>
      <description>&lt;P&gt;Got it. Thanks for sharing the documentation.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 15:38:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-reduce-perform-better-using-sorted-tables/m-p/12810772#M2025563</guid>
      <dc:creator>matteo_pascon</dc:creator>
      <dc:date>2023-06-16T15:38:29Z</dc:date>
    </item>
  </channel>
</rss>

