<?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: Querying from LIPS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750199#M1460014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are  6.035.246 rows in my LIPS table.&lt;/P&gt;&lt;P&gt;This my current explain plan. This is in QA &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SELECT STATEMENT ( Estimated Costs = 177 , Estimated #Rows = 531&lt;/EM&gt;                         &lt;/P&gt;&lt;P&gt;    &lt;EM&gt;Step 3 FILTER&lt;/EM&gt;                                   &lt;/P&gt;&lt;P&gt;        &lt;EM&gt;Step  2 TABLE ACCESS BY INDEX ROWID LIPS&lt;/EM&gt;                     &lt;/P&gt;&lt;P&gt;             &lt;EM&gt;( Estim. Costs = 176 , Estim. #Rows = 531 )&lt;/EM&gt;                                         &lt;/P&gt;&lt;P&gt;              &lt;EM&gt;Step 1 INDEX RANGE SCAN &lt;STRONG&gt;LIPS~Z39&lt;/STRONG&gt;&lt;/EM&gt;                        &lt;/P&gt;&lt;P&gt;                 &lt;EM&gt;( Estim. Costs = 27 , Estim. #Rows = 6.897 )&lt;/EM&gt;     &lt;/P&gt;&lt;P&gt;                 &lt;EM&gt;Search Columns: 3&lt;/EM&gt;                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, it uses z39 index that i already created&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NONUNIQUE  Index   &lt;STRONG&gt;LIPS~Z39&lt;/STRONG&gt;&lt;/EM&gt;                &lt;/P&gt;&lt;P&gt;&lt;EM&gt;Column Name                     #Distinct&lt;/EM&gt;    &lt;/P&gt;&lt;P&gt;&lt;EM&gt;MANDT                                          5&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;LGORT                                         35&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;WERKS                                          5&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Apr 2010 08:47:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-22T08:47:45Z</dc:date>
    <item>
      <title>Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750194#M1460009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts, anyone have any idea how to improve my query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select vebln posnr from LIPS &lt;/P&gt;&lt;P&gt;where werks = p_werks&lt;/P&gt;&lt;P&gt;and lgort = p_lgort&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get data in lips based only on werks and lgort. I know it will be very heavy. But anyone know the workaround? Thank you in advances....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 14:00:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750194#M1460009</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-20T14:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750195#M1460010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Search for SAP Note about SD performance in customer programs...you may be able to utilize index table like VLKPA...there are other names, I can't recall at the moment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 00:02:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750195#M1460010</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-21T00:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750196#M1460011</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;     There are index table VLKPA and VLPMA.   But both tabe have good index for Plant/Storage location.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;      Our company add index   MANDT/MATNR/WERKS/LGORT in  table  Lips.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      I think  your case&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                MANDT/ WERKS/LGORT/MATNR or&lt;/P&gt;&lt;P&gt;               MANDT/ WERKS/LGORT/VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      Please study other abap program to use table LIPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Regards,&lt;/P&gt;&lt;P&gt;    Gaito&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 01:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750196#M1460011</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-21T01:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750197#M1460012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, thank you for the advices. I have looked at the VLKPA and VLPMA, both table don't have WERKS or LOGRT in it. How can i use them? Actually my actual SQL which is very heavy is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lips&lt;SUB&gt;werks lips&lt;/SUB&gt;lgort lips&lt;SUB&gt;vbeln lips&lt;/SUB&gt;erdat INTO TABLE ta_po FROM lips&lt;/P&gt;&lt;P&gt;INNER JOIN ekes ON lips&lt;SUB&gt;vbeln = ekes&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;WHERE lips~lgort = p_gate&lt;/P&gt;&lt;P&gt;  AND lips~werks = p_plant&lt;/P&gt;&lt;P&gt;  AND lips~pstyv = 'ZBC'&lt;/P&gt;&lt;P&gt;  AND ekes~dabmg = 0&lt;/P&gt;&lt;P&gt;  AND ekes~eindt in s_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, i want to get all data which is delivered by vendors and on the specific storage loc and plant. &lt;/P&gt;&lt;P&gt;In my LIPS, i have also already add index for mandt,  logrt and werks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 01:20:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750197#M1460012</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-21T01:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750198#M1460013</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;&amp;gt; SELECT lips&lt;SUB&gt;werks lips&lt;/SUB&gt;lgort lips&lt;SUB&gt;vbeln lips&lt;/SUB&gt;erdat INTO TABLE ta_po FROM lips&lt;/P&gt;&lt;P&gt;&amp;gt; INNER JOIN ekes ON lips&lt;SUB&gt;vbeln = ekes&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;&amp;gt; WHERE lips~lgort = p_gate&lt;/P&gt;&lt;P&gt;&amp;gt;   AND lips~werks = p_plant&lt;/P&gt;&lt;P&gt;&amp;gt;   AND lips~pstyv = 'ZBC'&lt;/P&gt;&lt;P&gt;&amp;gt;   AND ekes~dabmg = 0&lt;/P&gt;&lt;P&gt;&amp;gt;   AND ekes~eindt in s_date.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Basically, i want to get all data which is delivered by vendors and on the specific storage loc and plant. &lt;/P&gt;&lt;P&gt;&amp;gt; In my LIPS, i have also already add index for mandt,  logrt and werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how many records does LIPS have?&lt;/P&gt;&lt;P&gt;how many records are selected with your query?&lt;/P&gt;&lt;P&gt;what ist the current execution plan used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 08:37:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750198#M1460013</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-04-22T08:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750199#M1460014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are  6.035.246 rows in my LIPS table.&lt;/P&gt;&lt;P&gt;This my current explain plan. This is in QA &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SELECT STATEMENT ( Estimated Costs = 177 , Estimated #Rows = 531&lt;/EM&gt;                         &lt;/P&gt;&lt;P&gt;    &lt;EM&gt;Step 3 FILTER&lt;/EM&gt;                                   &lt;/P&gt;&lt;P&gt;        &lt;EM&gt;Step  2 TABLE ACCESS BY INDEX ROWID LIPS&lt;/EM&gt;                     &lt;/P&gt;&lt;P&gt;             &lt;EM&gt;( Estim. Costs = 176 , Estim. #Rows = 531 )&lt;/EM&gt;                                         &lt;/P&gt;&lt;P&gt;              &lt;EM&gt;Step 1 INDEX RANGE SCAN &lt;STRONG&gt;LIPS~Z39&lt;/STRONG&gt;&lt;/EM&gt;                        &lt;/P&gt;&lt;P&gt;                 &lt;EM&gt;( Estim. Costs = 27 , Estim. #Rows = 6.897 )&lt;/EM&gt;     &lt;/P&gt;&lt;P&gt;                 &lt;EM&gt;Search Columns: 3&lt;/EM&gt;                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, it uses z39 index that i already created&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NONUNIQUE  Index   &lt;STRONG&gt;LIPS~Z39&lt;/STRONG&gt;&lt;/EM&gt;                &lt;/P&gt;&lt;P&gt;&lt;EM&gt;Column Name                     #Distinct&lt;/EM&gt;    &lt;/P&gt;&lt;P&gt;&lt;EM&gt;MANDT                                          5&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;LGORT                                         35&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;WERKS                                          5&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 08:47:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750199#M1460014</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T08:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750200#M1460015</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;so you havee 6 million rows in QA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does your statment look like?&lt;/P&gt;&lt;P&gt;Like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select vebln posnr from LIPS &lt;/P&gt;&lt;P&gt;where werks = p_werks&lt;/P&gt;&lt;P&gt;and lgort = p_lgort .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is missing now is the number of rows&lt;/P&gt;&lt;P&gt;in the result set.... .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A full table scan might be faster if the result set is big.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 08:52:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750200#M1460015</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-04-22T08:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750201#M1460016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried 2 methods. &lt;/P&gt;&lt;P&gt;Firstly i have my sql like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SELECT lips&lt;SUB&gt;werks lips&lt;/SUB&gt;lgort lips&lt;SUB&gt;vbeln lips&lt;/SUB&gt;erdat INTO TABLE ta_po FROM lips&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;INNER JOIN ekes ON lips&lt;SUB&gt;vbeln = ekes&lt;/SUB&gt;vbeln&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;WHERE lips~lgort = p_gate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;AND lips~werks = p_plant&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;AND lips~pstyv = 'ZBC'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;AND ekes~dabmg = 0&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;AND ekes~eindt in s_date.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the result was very heavy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i tried to separate the SQL become 2 SQL. First is to select from LIPS by itself. Then select to EKES. This is the SQL to LIPS&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;select lips&lt;SUB&gt;werks lips&lt;/SUB&gt;lgort lips&lt;SUB&gt;vbeln lips&lt;/SUB&gt;erdat&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;into table l_ta_lips&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;from lips&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;where lips~mandt = sy-mandt&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;and lips~lgort = p_gate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;and lips~werks = p_plant&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;and lips~pstyv = 'ZBC'.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;describe table l_ta_lips.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;if sy-tfill &amp;gt; 0.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;select ekes~vbeln&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;into table l_ta_ekes&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;from ekes&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;for all entries in l_ta_lips&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;where vbeln = l_ta_lips-vbeln&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;and dabmg = 0&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;and eindt in s_date.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;loop at l_ta_lips into l_wa_lips.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;      &lt;EM&gt;read table l_ta_ekes into l_wa_ekes with key vbeln = l_wa_lips-vbeln.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;      &lt;EM&gt;if sy-subrc = 0.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;        &lt;EM&gt;append l_wa_lips to ta_po.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;      &lt;EM&gt;endif.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;    &lt;EM&gt;endloop.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;  &lt;EM&gt;endif.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The explain sql trace that i gave you on my previous thread is for selecting to LIPS only. And the weird thing is that in my ST05, i saw lots of FETCH from LIPS. And all of them FETCHING 1911 rows.&lt;/P&gt;&lt;P&gt;LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;LIPS       FETCH   1.911&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 09:02:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750201#M1460016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T09:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750202#M1460017</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;well, step by step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's ignore the join for a moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Then i tried to separate the SQL become 2 SQL. First is to select from LIPS by itself. Then select to EKES. This is the SQL to LIPS&lt;/P&gt;&lt;P&gt;&amp;gt;   &lt;EM&gt;select lips&lt;SUB&gt;werks lips&lt;/SUB&gt;lgort lips&lt;SUB&gt;vbeln lips&lt;/SUB&gt;erdat&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;   &lt;EM&gt;into table l_ta_lips&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;   &lt;EM&gt;from lips&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;   &lt;EM&gt;where lips~mandt = sy-mandt&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     &lt;EM&gt;and lips~lgort = p_gate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     &lt;EM&gt;and lips~werks = p_plant&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     &lt;EM&gt;and lips~pstyv = 'ZBC'.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; The explain sql trace that i gave you on my previous thread is for selecting to LIPS only. And the weird thing is that in my ST05, i saw lots of FETCH from LIPS. And all of them FETCHING 1911 rows.&lt;/P&gt;&lt;P&gt;&amp;gt; LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;&amp;gt; LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;&amp;gt; LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;&amp;gt; LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;&amp;gt; LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;&amp;gt; LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;&amp;gt; LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;&amp;gt; LIPS       FETCH   1.911&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not weird since you fetch lots of data and the application server communicates in packets with the database&lt;/P&gt;&lt;P&gt;and obviously more than one packet is necessary for all of your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many rows are selected in total from Lips?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many rows do we have for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;   &lt;EM&gt;where lips~mandt = sy-mandt&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     &lt;EM&gt;and lips~lgort = p_gate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     &lt;EM&gt;and lips~werks = p_plant&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     &lt;EM&gt;and lips~pstyv = 'ZBC'.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and how many for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;   &lt;EM&gt;where lips~mandt = sy-mandt&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     &lt;EM&gt;and lips~lgort = p_gate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     &lt;EM&gt;and lips~werks = p_plant&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 09:19:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750202#M1460017</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-04-22T09:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750203#M1460018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; How many rows are selected in total from Lips?  &lt;STRONG&gt;71000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; How many rows do we have for: &lt;STRONG&gt;71.755&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;where lips~mandt = sy-mandt&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;and lips~lgort = p_gate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;and lips~werks = p_plant&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;and lips~pstyv = 'ZBC'.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and how many for: &lt;STRONG&gt;71.756&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;where lips~mandt = sy-mandt&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;and lips~lgort = p_gate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;and lips~werks = p_plant&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 09:55:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750203#M1460018</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T09:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750204#M1460019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;Just to be sure that you are focusing on the right query, you have confirmed that EKES has an index by VBELN and that index is being used, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 10:02:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750204#M1460019</guid>
      <dc:creator>Rui_Dantas</dc:creator>
      <dc:date>2010-04-22T10:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750205#M1460020</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;so you are selecting &lt;SUB&gt;1 % (&lt;/SUB&gt;70.000) out of 6 Million rows. Therfore a&lt;/P&gt;&lt;P&gt;full table scan will not help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at what you have said you have an optimal index (MANDT, LGORT, WERKS)&lt;/P&gt;&lt;P&gt;in place for your where condition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where lips~mandt = sy-mandt&lt;/P&gt;&lt;P&gt;and lips~lgort = p_gate&lt;/P&gt;&lt;P&gt;and lips~werks = p_plant&lt;/P&gt;&lt;P&gt;and lips~pstyv = 'ZBC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pstyv does not further restrict the data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The execution plan seems to be optimal. If we assume 10 milliseconds per row&lt;/P&gt;&lt;P&gt;your query for LIPS should run 700 seconds (11 minutes 40 seconds) - might&lt;/P&gt;&lt;P&gt;be faster or slower - depends on caching and the I/O system. If you want to&lt;/P&gt;&lt;P&gt;have it faster you have to start parallelization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are your run times for LIPS? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Rui said, for the join, VBELN should be used in an index on EKES. Run times&lt;/P&gt;&lt;P&gt;will be slower you can add additional 10 ms for each matching row from EKES (rule of thumb).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Rui said, maybe the problem for the join might be for&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 10:45:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750205#M1460020</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-04-22T10:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Querying from LIPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750206#M1460021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, i use VBELN index in EKES&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 12:55:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/querying-from-lips/m-p/6750206#M1460021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T12:55:19Z</dc:date>
    </item>
  </channel>
</rss>

