<?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: WHERE condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211473#M765654</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clemens - are you saying that it would be faster to go to BSIS or BSAS using BUKRS, BELNR and GJAHR than it would be to go to BSEG with the same fields, even though there is no secondary index on those fields in BSIS or BSAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Dec 2007 14:46:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-14T14:46:37Z</dc:date>
    <item>
      <title>WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211462#M765643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any diffrence in performance between the following two statements ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT BUKRS BELNR GJAHR AUGBL&lt;/P&gt;&lt;P&gt;           INTO TABLE TEMP_BSEG&lt;/P&gt;&lt;P&gt;           FROM BSEG&lt;/P&gt;&lt;P&gt;           WHERE BUKRS IN S_CCODE&lt;/P&gt;&lt;P&gt;           AND   BELNR IN S_BELNR&lt;/P&gt;&lt;P&gt;           AND   GJAHR IN S_GJAHR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT BUKRS BELNR GJAHR AUGBL&lt;/P&gt;&lt;P&gt;           INTO TABLE TEMP_BSEG&lt;/P&gt;&lt;P&gt;           FROM BSEG&lt;/P&gt;&lt;P&gt;           WHERE BUKRS IN S_CCODE&lt;/P&gt;&lt;P&gt;           AND   BELNR IN S_BELNR&lt;/P&gt;&lt;P&gt;           AND   GJAHR IN S_GJAHR&lt;/P&gt;&lt;P&gt;          AND   KOART = 'K'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 22:24:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211462#M765643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T22:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211463#M765644</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;Use the 2nd option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT BUKRS BELNR GJAHR AUGBL
INTO TABLE TEMP_BSEG
FROM BSEG
WHERE BUKRS IN S_CCODE
AND BELNR IN S_BELNR
AND GJAHR IN S_GJAHR
AND KOART = 'K'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 22:31:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211463#M765644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T22:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211464#M765645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your requirement is to take only BSEG records with KOART = 'K', I would do it the second way. Performance shouldn't really be an issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 22:32:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211464#M765645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T22:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211465#M765646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think there should be some difference in the performance of the first statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st is better when compared to the second select statement, being in the first select statement you are using 3 key fields where as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the 2nd select statement 2 key fields and one non key field in the where condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where as in the second select statement you are directly takeing only particular type of values corresponding to non key field ('K') so it should be better..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance wise i am not sure about the considerable performance difference in both the statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;though u can check the performance of these 2 statements in ST05.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 22:35:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211465#M765646</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T22:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211466#M765647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Naveen - the second select uses the same three key fields as the first (the full primary key). It also uses another non-key field. I would expect that this would place a very small extra load on the database server, but this should be outweighed by the fact that the database will be returning fewer records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, less work will have to be done on the application server side because the records already have the extra filter applied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 22:39:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211466#M765647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T22:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211467#M765648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup exacty Rob.... I didn't see 1st key field in the second select statement... my mistake&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 22:42:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211467#M765648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T22:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211468#M765649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi K N,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;almost everything has been said.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you are still better selecting not from BSEG but from BSAS if you are lookin for cleared documents (AUGBL filled). BSAS is the secondary index table. Less fields, löess records. And if you have the GL account, you can make good better of the index.&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;Clemens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 22:56:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211468#M765649</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-12-13T22:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211469#M765650</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 have some 140 million records in BSEG where i need to pick AUGBL field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, which method u suggest ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using the second statement above ?&lt;/P&gt;&lt;P&gt; or Creating indexes on BSIK  and BSAK tables ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 23:15:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211469#M765650</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T23:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211470#M765651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why would you want to create a secondary index on BSIK and BSAK for a single SELECT? Either of your other two solutions is better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One or the other of the first two will be best (by a small amount), but the only way to say for sure is for &amp;lt;u&amp;gt;you&amp;lt;/u&amp;gt; to try both with a variety of SELECT options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said that, there already is a secondaryindex on both BSIK and BSAK for BUKRS, BELNR and GJAHR.&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;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 03:36:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211470#M765651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T03:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211471#M765652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone for sharing their views. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the second query and have no prolems so far.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 04:21:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211471#M765652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T04:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211472#M765653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no, you do not have to create a secondary index. BSIS and BSAS are secondary index tables for BKPF/BSEG. They have far less entries and far less fields than BKPF/BSEG. Access using those tables is faster even if you don't supply full primary key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is almost always better to use the secondary index tables before or instead of accessing BKPF/BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BSID Accounting- Secondary Index for Customers&lt;/P&gt;&lt;P&gt;BSIK Accounting- Secondary Index for Vendors&lt;/P&gt;&lt;P&gt;BSIM Secondary Index, Documents for Material&lt;/P&gt;&lt;P&gt;BSIS Accounting- Secondary Index for G/L Accounts&lt;/P&gt;&lt;P&gt;BSAD Accounting- Secondary Index for Customers (Cleared Items)&lt;/P&gt;&lt;P&gt;BSAK Accounting- Secondary Index for Vendors (Cleared Items)&lt;/P&gt;&lt;P&gt;BSAS Accounting- Secondary Index for G/L Accounts (Cleared Items)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is just one minor precondition: You got to know what you want &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 11:57:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211472#M765653</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-12-14T11:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211473#M765654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clemens - are you saying that it would be faster to go to BSIS or BSAS using BUKRS, BELNR and GJAHR than it would be to go to BSEG with the same fields, even though there is no secondary index on those fields in BSIS or BSAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 14:46:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211473#M765654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T14:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211474#M765655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes, roughly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BSIS and BSAS have primary key fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUKRS&lt;/P&gt;&lt;P&gt;HKONT&lt;/P&gt;&lt;P&gt;AUGDT&lt;/P&gt;&lt;P&gt;AUGBL&lt;/P&gt;&lt;P&gt;ZUONR&lt;/P&gt;&lt;P&gt;GJAHR&lt;/P&gt;&lt;P&gt;BELNR&lt;/P&gt;&lt;P&gt;BUZEI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For BSIS, AUGDT and AUGBL are always initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure you are better off if you can supply the GL account in HKONT. But even if not, BSIS/BSAS are transparent tables with far less records and much better access.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 15:06:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211474#M765655</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-12-14T15:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211475#M765656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clemens - have you actually tried this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2007 15:10:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211475#M765656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T15:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211476#M765657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a small program that compares the various suggestions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ztest MESSAGE-ID 00.

TABLES: bkpf, bsis, bsas, bseg.

DATA: bkpf_int TYPE TABLE OF bkpf,
      bseg_int TYPE TABLE OF bseg,
      bsis_int TYPE TABLE OF bsis,
      bsik_int TYPE TABLE OF bsik.

DATA: start     TYPE i,
      end       TYPE i,
      dif       TYPE i.

SELECT * FROM bkpf INTO TABLE bkpf_int UP TO 1000 ROWS.

DO 5 TIMES.
  GET RUN TIME FIELD start.

  SELECT * FROM bsik INTO TABLE bsik_int
    FOR ALL ENTRIES IN bkpf_int
    WHERE bukrs = bkpf_int-bukrs
      AND belnr = bkpf_int-belnr
      AND gjahr = bkpf_int-gjahr.

  SELECT * FROM bsak APPENDING TABLE bsik_int
    FOR ALL ENTRIES IN bkpf_int
    WHERE bukrs = bkpf_int-bukrs
      AND belnr = bkpf_int-belnr
      AND gjahr = bkpf_int-gjahr.

  GET RUN TIME FIELD end.
  dif = end - start.
  WRITE: /001 'Time for indexed SELECT from BSIK/BSAK  :', dif,
              'microseconds'.

  GET RUN TIME FIELD start.

  SELECT * FROM bsis INTO TABLE bsis_int
    FOR ALL ENTRIES IN bkpf_int
    WHERE bukrs = bkpf_int-bukrs
      AND belnr = bkpf_int-belnr
      AND gjahr = bkpf_int-gjahr.

  SELECT * FROM bsas APPENDING TABLE bsis_int
    FOR ALL ENTRIES IN bkpf_int
    WHERE bukrs = bkpf_int-bukrs
      AND belnr = bkpf_int-belnr
      AND gjahr = bkpf_int-gjahr.

  GET RUN TIME FIELD end.
  dif = end - start.
  WRITE: /001 'Time for unindexed SELECT from BSIS/BSAS:', dif,
              'microseconds'.

  GET RUN TIME FIELD start.

  SELECT * FROM bseg INTO TABLE bseg_int
    FOR ALL ENTRIES IN bkpf_int
    WHERE bukrs = bkpf_int-bukrs
      AND belnr = bkpf_int-belnr
      AND gjahr = bkpf_int-gjahr.

  GET RUN TIME FIELD end.
  dif = end - start.
  WRITE: /001 'Time for indexed SELECT from BSEG       :', dif,
              'microseconds'.

  GET RUN TIME FIELD start.

  SELECT * FROM bseg INTO TABLE bseg_int
    FOR ALL ENTRIES IN bkpf_int
    WHERE bukrs = bkpf_int-bukrs
      AND belnr = bkpf_int-belnr
      AND gjahr = bkpf_int-gjahr
      AND koart = 'K'.

  GET RUN TIME FIELD end.
  dif = end - start.
  WRITE: /001 'Time for indexed SELECT from BSEG       :', dif,
              'microseconds (includes KOART)'.

  SKIP 1.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SELECT against BSEG using KOART generally gave the best time. The unindexed SELECT against BSIS and BSAS was always the worst. But I don't think it matters, because the records that he wants won't be in these 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>Fri, 14 Dec 2007 20:15:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211476#M765657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-14T20:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211477#M765658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your efforts. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe my suggestion is not good in any case. We had a similar task where we know the GL account number - this helped for good results accessing BSIS/BSAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And we have an extremely slow system here and the number of BSEG data records is huge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"i have some 140 million records in BSEG where i need to pick AUGBL field."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your test program did not run against 140 million BSEG records, did it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's what you have in BSAS primary key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cleared items will almost always get posted to GL accounts. You may identify the relevant GL accounts and enhance the selection.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Dec 2007 16:36:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211477#M765658</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-12-15T16:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211478#M765659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A few things:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In database access, the most important thing to do is to use an index effectively. There is no way that going to BSIS and BSAS without an index would be faster than going to BSEG with the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the number of records in BSEG grows, the number of records in BSIS/BSAS will grow linearly, so trying to go to these tables will get worse with more records, not better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original poster clearly said that he wanted to SELECT with KOART = 'K'. This means that he wants vendor accounts, not GL accounts. There is a secondary index in BSIK/BSAK on BUKRS, BELNR and GJAHR so that would be better than going to BSIS and BSAS with these fields. But you'll notice that I included this table in the sample program that I wrote and even in this case going to BSEG was faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a common misconception that going to BSEG is slow.&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, 15 Dec 2007 19:19:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/3211478#M765659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-15T19:19:46Z</dc:date>
    </item>
  </channel>
</rss>

