<?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: Read Performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428132#M823420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Today's sort order may not be tomorrow's.&lt;/P&gt;&lt;P&gt;No, I would call it bad design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Binary search is actually slightly faster than sorted read, but still, the recommendation is to use special tables, because they are much more fault tolerant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I do not understand your argument. I can change the sort order of a sorted globally by one coding change. There is nearly no chance to change a sort order&lt;/P&gt;&lt;P&gt;of an existing standard table, because it might be used in dynamic coding. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Feb 2008 15:52:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-20T15:52:54Z</dc:date>
    <item>
      <title>Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428124#M823412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I make the performance of my search better when I Read a table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Feb 2008 07:05:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428124#M823412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-16T07:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428125#M823413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Biju,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Use BINARY SEARCH in READ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pre-requisite for using binary search is , u have to sort the internal table for the fields used in the where condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB BY MATNR.&lt;/P&gt;&lt;P&gt;READ TABLE ITAB WITH KEY MATNR = V_MATNR BINARY SEARCH.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Feb 2008 07:28:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428125#M823413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-16T07:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428126#M823414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By defalut, read command on internal table will read it sequentially. The binary search algorithm helps faster search of a value in an internal table. But you must sort it before use binary search. Binary search repeatedly divides the search interval in half. If the value to be searched is less than the item in the middle of the interval, the search is narrowed to the lower half, otherwise the search is narrowed to the upper half.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Feb 2008 07:31:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428126#M823414</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-16T07:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428127#M823415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use Sorted or Hashed tables.&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, 16 Feb 2008 19:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428127#M823415</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-16T19:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428128#M823416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In new developments you should use sorted or hashed tables.&lt;/P&gt;&lt;P&gt;Sorted tables are always sorted and can use binary search automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables must search sequentially by default, because it is not guaranteed that the table is sorted. Therefore you must sort and use binary search manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 08:49:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428128#M823416</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-18T08:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428129#M823417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tend to re-use internal tables and find that defining them as anything but standard reduces flexibility, so I don't use sorted or hashed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2008 17:38:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428129#M823417</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-18T17:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428130#M823418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;reuse tables in a standard application or in a test program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would say that flexibility is highly overestimated. Performance critcial are the really large internal tables, the ones which grows with the processed data. They should not be reused.&lt;/P&gt;&lt;P&gt;There are actually not that many application where a resorting makes sense. A key should be defined carefully. And in new basis releases it will be possible to define secondary keys.&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, 19 Feb 2008 10:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428130#M823418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T10:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428131#M823419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I disagree Siegfried. If there is any performance gain to be gotten by using sorted or hashed tables over sorted standard tables, I don't think it's worth the programming price. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We work in a world where requirements change during the development life cycle. Today's sort order may not be tomorrow's. The same table may have to be sorted different ways depending on requirements. The programmer may be mistaken in a way that requires more than one internal table change. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Programmers tend to be highly paid creatures. I don't think it helps to add additional complexity to save microseconds. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're interested, see: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Performance - what will kill you and what will leave you with only a flesh wound|/people/rob.burbank/blog/2006/11/16/performance--what-will-kill-you-and-what-will-leave-you-with-only-a-flesh-wound] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 15:15:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428131#M823419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T15:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428132#M823420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Today's sort order may not be tomorrow's.&lt;/P&gt;&lt;P&gt;No, I would call it bad design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Binary search is actually slightly faster than sorted read, but still, the recommendation is to use special tables, because they are much more fault tolerant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I do not understand your argument. I can change the sort order of a sorted globally by one coding change. There is nearly no chance to change a sort order&lt;/P&gt;&lt;P&gt;of an existing standard table, because it might be used in dynamic coding. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 15:52:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428132#M823420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T15:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428133#M823421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not bad design - changing requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 15:57:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428133#M823421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T15:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428134#M823422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sounds very theoretical,  an internal table has a main access key. But hwo should it happen that this changes to something completely different.&lt;/P&gt;&lt;P&gt;I have never seen that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might happen that an additional key field is necessary, but that is no problem for sorted table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might happen that other access types become also important. This is sometimes the case. But then in most cases, both access paths are at the same&lt;/P&gt;&lt;P&gt;time important. It does not make sense to resort the table (a sort is costly it needs many binary searchs to justify the cost). Here oinly secondary keys really help.&lt;/P&gt;&lt;P&gt;Up to that release, table copies of different order are necessary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 16:20:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428134#M823422</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T16:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428135#M823423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;nice to see two titans butt heads over an interesting topic! (although the question is answered and points awarded to the errr best answers...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one example in favor of SORTED table from my practice. In (quite rare) cases I have to work with nested loops over two internal tables, which are obviously linked by a key of some sort. In the inner loop, I cannot give the addition BINARY SEARCH for the LOOP statement, so I definetely want this inner table to be a SORTED one, so only those records will be scanned, that match the WHERE condition in the loop statement, without a full table scan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I rarely use HASHED tables though, if at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: this applies of course not only to nested loops, but whenever you access an internal table not by READ TABLE ... BINARY SEARCH but by LOOP AT ... WHERE ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 16:37:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428135#M823423</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-02-20T16:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428136#M823424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changing requirements is maybe a bad example, but many times I get an internal table, sort it one way, do some processing, sort it a different way, do some more processing, etc. I find a standard table easy to use for this (ie. more flexible - which was my point).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Heehee - it was me that suggested sorted/hashed tables.&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;Edited by: Rob Burbank on Feb 20, 2008 12:39 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 17:28:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428136#M823424</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T17:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428137#M823425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Thomas&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is actually also for the LOOP AT WHERE a performant solution with standard tables, see last section of&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Measurements on internal tables: Reads and Loops:&lt;/P&gt;&lt;P&gt;/people/siegfried.boes/blog/2007/09/12/runtimes-of-reads-and-loops-on-internal-tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the exit condition is missing then it is not really faster!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recommend sorted tables, because 90% of the programmer don't know that LOOP at WHERE with standard tables is not optimized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem of non-scalable programs is a serious one. But here in the forum it is rarely discussed. And my 2 blogs about a method to identify such problems &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nonlinearity Check&lt;/P&gt;&lt;P&gt;/people/siegfried.boes/blog/2008/01/24/nonlinearity-check-using-the-zse30compare&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Z_SE30_COMPARE&lt;/P&gt;&lt;P&gt;/people/siegfried.boes/blog/2008/01/15/a-tool-to-compare-runtime-measurements-zse30compare&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are not really popular.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables actually make sense when GUIDs are used. They are faster only for very large tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Rob&lt;/P&gt;&lt;P&gt;that's why I asked whether you talk about application programs or test programs. In performance critical program&lt;/P&gt;&lt;P&gt;you should think about resorting your tables. I have not seen many programs where a table is for while exclusively accessed in one type and then exclusively in another.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen more often&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1&lt;/P&gt;&lt;P&gt;  sort itab2&lt;/P&gt;&lt;P&gt;  read itab2 ... binary search&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 17:56:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428137#M823425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T17:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428138#M823426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I've never seen a program where a binary search on a sorted standard table wasn't fast enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 18:02:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428138#M823426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T18:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read Performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428139#M823427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siegfried,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've studied and like your blogs about ST05 and SE30, will check out these other ones as well.&lt;/P&gt;&lt;P&gt;&amp;gt;But here in the forum it is rarely discussed&lt;/P&gt;&lt;P&gt;Unfortunately so. Well, I have my whitelist of people who keep posting advanced content...guess who's on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 21:07:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-performance/m-p/3428139#M823427</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-02-20T21:07:11Z</dc:date>
    </item>
  </channel>
</rss>

