<?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: performance with where condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485457#M1061879</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Please try to give the fields in order of the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm reading it a lot around here, that this would make a difference. Actually I cannot imagine that it does. Is there any proof that the sequence of fields in the WHERE-condition does make any difference on performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The real problem of that SELECT is that no primary or secondary key is being used. Unfortunately I did not find a way to speed this up, except the very last resort, creating a new secondary index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Sep 2008 07:29:39 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2008-09-11T07:29:39Z</dc:date>
    <item>
      <title>performance with where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485455#M1061877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT VBELN FKART WAERK VKORG VTWEG REGIO&lt;/P&gt;&lt;P&gt;         KNUMV FKDAT KDGRP KUNAG KUNRG SPART&lt;/P&gt;&lt;P&gt;         KURRF BSTNK_VF KALSM&lt;/P&gt;&lt;P&gt;  FROM VBRK&lt;/P&gt;&lt;P&gt;  INTO TABLE IT_VBRK&lt;/P&gt;&lt;P&gt;  WHERE FKART IN  ('F2','RE','G2','L2','S1','S2','ZKSF','ZRE','ZS1')&lt;/P&gt;&lt;P&gt;  AND   SPART  =  P_SPART&lt;/P&gt;&lt;P&gt;  AND   FKDAT IN  S_FKDAT&lt;/P&gt;&lt;P&gt;  AND   VKORG  =  P_VKORG&lt;/P&gt;&lt;P&gt;  AND   VTWEG  IN S_VTWEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this query lot time.. any way to improve for same where condition...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Sep 11, 2008 10:15 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2008 06:27:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485455#M1061877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-11T06:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: performance with where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485456#M1061878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi malay gal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT VBELN FKART WAERK VKORG VTWEG KALSM
KNUMV FKDAT KDGRP KURRF 
REGIO KUNRG  KUNAG SPART BSTNK_VF 
FROM VBRK
INTO TABLE IT_VBRK
WHERE FKART IN ('F2','RE','G2','L2','S1','S2','ZKSF','ZRE','ZS1')
AND VKORG = P_VKORG
AND VTWEG IN S_VTWEG
AND FKDAT IN S_FKDAT
AND SPART = P_SPART.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to give the fields in order of the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2008 06:36:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485456#M1061878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-11T06:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: performance with where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485457#M1061879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Please try to give the fields in order of the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm reading it a lot around here, that this would make a difference. Actually I cannot imagine that it does. Is there any proof that the sequence of fields in the WHERE-condition does make any difference on performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The real problem of that SELECT is that no primary or secondary key is being used. Unfortunately I did not find a way to speed this up, except the very last resort, creating a new secondary index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2008 07:29:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485457#M1061879</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-11T07:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: performance with where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485458#M1061880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good point!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if one really would benchmark this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create some views with different orders of the fields and compare runtimes with a pure table access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(to be honest I never did that)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the database point of view data is stored in logical pieces (like blocks ) , organized into higher levels like segments (tables, indices) and they point at least to physical blocks on the hard disk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The order of fields in a SELECT query has no significancef for the runtime because the data is read by the database in mentioned logical blocks and transported to the output buffer.&lt;/P&gt;&lt;P&gt;In a more theoretically background this aligns with one of the rules of relational databases that you should not know anything about the physical structure to access the data - only where to get it from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of fields is important...&lt;/P&gt;&lt;P&gt;sure it's a good habit not to waste resources anyway (buffering a * selection with hundreds of fields is a waste if you only need 2 of them.&lt;/P&gt;&lt;P&gt;sure if a table consist of hundreds of fields , that must be spread onto several blocks to store the rows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2008 08:18:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485458#M1061880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-11T08:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: performance with where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485459#M1061881</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;&lt;STRONG&gt;1. for your SQL I have only a comment about the IN clauses:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;AND FKDAT IN S_FKDAT   -&amp;gt; S_FKDAT should be filled with some values&lt;/P&gt;&lt;P&gt;AND VKORG = P_VKORG&lt;/P&gt;&lt;P&gt;AND VTWEG IN S_VTWEG. -&amp;gt; S_VTWEG should be filled with some values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. check table statistics, get a execution plan with ST05 and post it here.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Thomas said, an index access may helpful. So we don't no how your SQL &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is processed , we can give no further clue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2008 08:35:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485459#M1061881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-11T08:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: performance with where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485460#M1061882</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;SELECT VBELN FKART WAERK VKORG VTWEG KALSM&lt;/P&gt;&lt;P&gt;KNUMV FKDAT KDGRP KURRF &lt;/P&gt;&lt;P&gt;REGIO KUNRG  KUNAG SPART BSTNK_VF &lt;/P&gt;&lt;P&gt;FROM VBRK&lt;/P&gt;&lt;P&gt;INTO TABLE IT_VBRK&lt;/P&gt;&lt;P&gt;WHERE FKART IN ('F2','RE','G2','L2','S1','S2','ZKSF','ZRE','ZS1')&lt;/P&gt;&lt;P&gt;AND VKORG = P_VKORG&lt;/P&gt;&lt;P&gt;AND VTWEG IN S_VTWEG&lt;/P&gt;&lt;P&gt;AND FKDAT IN S_FKDAT&lt;/P&gt;&lt;P&gt;AND SPART = P_SPART.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please try this code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2008 11:34:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485460#M1061882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-11T11:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: performance with where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485461#M1061883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Malay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please fetched the fields in the order they are in the database and another thing is the values,&lt;/P&gt;&lt;P&gt;'F2','RE','G2','L2','S1','S2','ZKSF','ZRE','ZS1' can be put in a range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope these two things can help to improve the performance.&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;Shobana.K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2008 08:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485461#M1061883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-12T08:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: performance with where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485462#M1061884</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;I am wondering! none of the fields you are using in the WHERE clause are neither key fields nor fields that match with any indexe. I am not sure about the requirement of your query, but suggest you to add either VBELN or LCNUM fields in the WHERE clause. VBELN is a key field and LCNUM field has index on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2008 14:02:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-with-where-condition/m-p/4485462#M1061884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-12T14:02:38Z</dc:date>
    </item>
  </channel>
</rss>

