<?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 Database SELECT performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908241#M378342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am doing some work that involves a large table view (COVP). The view has somewhere in the region of 7 million entries and growing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been doing some tests on selecting data from the view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM covp INTO TABLE t_covp
    WHERE objnr EQ 'OR000002000571'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the select has a duration of 183,411,192 (accoring to the trace log).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM covp INTO TABLE t_covp
    WHERE objnr EQ 'OR000002000571'
      AND lednr EQ '00'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the select only has a duration of 24,591 (according to the trace).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both select statements return the same result set (6 records).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously, the first select takes far to long. My question is, why is there such a large difference in run times. Neither of the fields are key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Feb 2007 10:15:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-27T10:15:56Z</dc:date>
    <item>
      <title>Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908241#M378342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am doing some work that involves a large table view (COVP). The view has somewhere in the region of 7 million entries and growing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been doing some tests on selecting data from the view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM covp INTO TABLE t_covp
    WHERE objnr EQ 'OR000002000571'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the select has a duration of 183,411,192 (accoring to the trace log).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM covp INTO TABLE t_covp
    WHERE objnr EQ 'OR000002000571'
      AND lednr EQ '00'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the select only has a duration of 24,591 (according to the trace).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both select statements return the same result set (6 records).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously, the first select takes far to long. My question is, why is there such a large difference in run times. Neither of the fields are key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 10:15:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908241#M378342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T10:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908242#M378343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Since you have given both the key fields(not always) in the where condition of the Select, the second one took less time.&lt;/P&gt;&lt;P&gt;It's always good to give all the key fields(Major data fields) in the where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;anji&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Anji Reddy Vangala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 10:18:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908242#M378343</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T10:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908243#M378344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stuart,&lt;/P&gt;&lt;P&gt;  The more key fields(Primary or otherwise) you pass to the select statement, it easier it becomes for the processor. Hence it is an important guideline in most performance improvement docuemants to provide the complete key for data retrievals.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 10:21:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908243#M378344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T10:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908244#M378345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stuart,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There might be several reasons: if the selects are performed shortly after another the results of the second run will be influenced by the first run (buffering). Furthermore there might be indexes defined for one of the underlying tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be sure: switch on the SQL-trace to find out the reason.&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;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 10:23:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908244#M378345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T10:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908245#M378346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to make sure whether buffering is happening, try to run those statements in reverse order and see if you can see the same amoutn of time.  Alternatively SQL trace also tells you whether buffer was used or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont see much of a difference by using LEDNR, so the improvement must be due to buffering effect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 10:31:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908245#M378346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T10:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908246#M378347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm. I don't think it's a buffering effect. If this was the case then surely only the second select statement would benefit.&lt;/P&gt;&lt;P&gt;I actually performed these selects the other way round (the slower one was done second).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Stuart Mayor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 10:38:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908246#M378347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T10:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908247#M378348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stuart,&lt;/P&gt;&lt;P&gt;             The Tables COEP and COBK has been joined to form the View COVP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the Indexes of the transparent table COEP in which the fields OBJNR and LEDNR have been marked which may increase the performance of DB fetch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 13:19:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908247#M378348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T13:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908248#M378349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The main criterion which drives performane is the number of fields you select and the number of where condition you specify in your select statemnt ( Primary or otherwise)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two together are directly proportional to the performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 14:02:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908248#M378349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T14:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Database SELECT performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908249#M378350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead of using SELECT *&lt;/P&gt;&lt;P&gt;select only those fields which you specifically need for the rest of the program this would even increase your performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 14:03:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-select-performance/m-p/1908249#M378350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T14:03:26Z</dc:date>
    </item>
  </channel>
</rss>

