<?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: Select querry (bypassing buffer) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510076#M844241</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;... BYPASSING BUFFER &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition causes the SELECT statement to avoid the SAP buffering and to read directly from the database and not from the buffer on the application server. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mayank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Mar 2008 05:47:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-14T05:47:01Z</dc:date>
    <item>
      <title>Select querry (bypassing buffer)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510075#M844240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please tell me how does this BYPASSING BUFFER in the following codes work? &amp;amp; how is the 2nd codes without using Bypassing buffer different from the first?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM T100 INTO T100_WA&lt;/P&gt;&lt;P&gt;  BYPASSING BUFFER&lt;/P&gt;&lt;P&gt;  WHERE     SPRSL = 'D'&lt;/P&gt;&lt;P&gt;        AND ARBGB = '00'&lt;/P&gt;&lt;P&gt;        AND MSGNR = '999'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM T100  INTO T100_WA&lt;/P&gt;&lt;P&gt;  WHERE     SPRSL = 'D'&lt;/P&gt;&lt;P&gt;        AND ARBGB = '00'&lt;/P&gt;&lt;P&gt;        AND MSGNR = '999'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 05:38:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510075#M844240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T05:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Select querry (bypassing buffer)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510076#M844241</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;... BYPASSING BUFFER &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition causes the SELECT statement to avoid the SAP buffering and to read directly from the database and not from the buffer on the application server. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mayank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 05:47:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510076#M844241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T05:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select querry (bypassing buffer)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510077#M844242</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;Using buffered tables improves the performance considerably. Note that in some cases a statement can not be used with a buffered table, so when using these statements the buffer will be bypassed. These statements are: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select DISTINCT &lt;/P&gt;&lt;P&gt;ORDER BY / GROUP BY / HAVING clause &lt;/P&gt;&lt;P&gt;Any WHERE clause that contains a sub query or IS NULL expression &lt;/P&gt;&lt;P&gt;JOIN s &lt;/P&gt;&lt;P&gt;A SELECT... FOR UPDATE &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;If you wan t to explicitly bypass the buffer, use the BYPASS BUFFER addition to the SELECT clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 05:47:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510077#M844242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T05:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select querry (bypassing buffer)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510078#M844243</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;In First code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is reading the data from buffer which is in application server.So performance will improve.Because not accessing the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In select code.&lt;/P&gt;&lt;P&gt;  Accessing the table to get the data.Performance is low compare to first one. This can recognize when extracing the huge data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reduce the Database Load &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unlike application servers and presentation servers, there is only one database server in your system. You should therefore aim to reduce the database load as much as possible. You can use the following methods: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Buffer Tables on the Application Server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can considerably reduce the time required to access data by buffering it in the application server table buffer. Reading a single entry from table T001 can take between 8 and 600 milliseconds, while reading it from the table buffer takes 0.2 - 1 milliseconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether a table can be buffered or not depends its technical attributes in the ABAP Dictionary. There are three buffering types: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident buffering (100%) The first time the table is accessed, its entire contents are loaded in the table buffer. &lt;/P&gt;&lt;P&gt;Generic buffering In this case, you need to specify a generic key (some of the key fields) in the technical settings of the table in the ABAP Dictionary. The table contents are then divided into generic areas. When you access data with one of the generic keys, the whole generic area is loaded into the table buffer. Client-specific tables are often buffered generically by client. &lt;/P&gt;&lt;P&gt;Partial buffering (single entry) Only single entries are read from the database and stored in the table buffer.&lt;/P&gt;&lt;P&gt;When you read from buffered tables, the following happens: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An ABAP program requests data from a buffered table. &lt;/P&gt;&lt;P&gt;The ABAP processor interprets the Open SQL statement. If the table is defined as a buffered table in the ABAP Dictionary, the ABAP processor checks in the local buffer on the application server to see if the table (or part of it) has already been buffered. &lt;/P&gt;&lt;P&gt;If the table has not yet been buffered, the request is passed on to the database. If the data exists in the buffer, it is sent to the program. &lt;/P&gt;&lt;P&gt;The database server passes the data to the application server, which places it in the table buffer. &lt;/P&gt;&lt;P&gt;The data is passed to the program. &lt;/P&gt;&lt;P&gt;When you change a buffered table, the following happens: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The database table is changed and the buffer on the application server is updated. The database interface logs the update statement in the table DDLOG. If the system has more than one application server, the buffer on the other servers is not updated at once. &lt;/P&gt;&lt;P&gt;All application servers periodically read the contents of table DDLOG, and delete the corresponding contents from their buffers where necessary. The granularity depends on the buffering type. The table buffers in a distributed system are generally synchronized every 60 seconds (parameter: rsdisp/bufreftime). &lt;/P&gt;&lt;P&gt;Within this period, users on non-synchronized application servers will read old data. The data is not recognized as obsolete until the next buffer synchronization. The next time it is accessed, it is re-read from the database.&lt;/P&gt;&lt;P&gt;You should buffer the following types of tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables that are read very frequently &lt;/P&gt;&lt;P&gt;Tables that are changed very infrequently &lt;/P&gt;&lt;P&gt;Relatively small tables (few lines, few columns, or short columns) &lt;/P&gt;&lt;P&gt;Tables where delayed update is acceptable.&lt;/P&gt;&lt;P&gt;Once you have buffered a table, take care not to use any Open SQL statements that bypass the buffer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SELECT statement bypasses the buffer when you use any of the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BYPASSING BUFFER addition in the FROM clause &lt;/P&gt;&lt;P&gt;The DISTINCT addition in the SELECT clause &lt;/P&gt;&lt;P&gt;Aggregate expressions in the SELECT clause &lt;/P&gt;&lt;P&gt;Joins in the FROM clause &lt;/P&gt;&lt;P&gt;The IS NULL condition in the WHERE clause &lt;/P&gt;&lt;P&gt;Subqueries in the WHERE clause &lt;/P&gt;&lt;P&gt;The ORDER BY clause &lt;/P&gt;&lt;P&gt;The GROUP BY clause &lt;/P&gt;&lt;P&gt;The FOR UPDATE addition&lt;/P&gt;&lt;P&gt;Furthermore, all Native SQL statements bypass the buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid Reading Data Repeatedly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you avoid reading the same data repeatedly, you both reduce the number of database accesses and reduce the load on the database. Furthermore, a "dirty read" may occur with database tables other than Oracle. This means that the second time you read data from a database table, it may be different from the data read the first time. To ensure that the data in your program is consistent, you should read it once only and then store it in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort Data in Your ABAP Programs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ORDER BY clause in the SELECT statement is not necessarily optimized by the database system or executed with the correct index. This can result in increased runtime costs. You should only use ORDER BY if the database sort uses the same index with which the table is read. To find out which index the system uses, use SQL Trace in the ABAP Workbench Performance Trace. If the indexes are not the same, it is more efficient to read the data into an internal table or extract and sort it in the ABAP program using the SORT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Logical Databases&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP supplies logical databases for all applications. A logical database is an ABAP program that decouples Open SQL statements from application programs. They are optimized for the best possible database performance. However, it is important that you use the right logical database. The hierarchy of the data you want to read must reflect the structure of the logical database, otherwise, they can have a negative effect on performance. For example, if you want to read data from a table right at the bottom of the hierarchy of the logical database, it has to read at least the key fields of all tables above it in the hierarchy. In this case, it is more efficient to use a SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Pls. reward if usefulll&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 05:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510078#M844243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T05:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select querry (bypassing buffer)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510079#M844244</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;Single-record buffering is recommended particularly for large tables in which only a few records are&lt;/P&gt;&lt;P&gt;accessed repeatedly with SELECT SINGLE. All the accesses to the table that do not use SELECT&lt;/P&gt;&lt;P&gt;SINGLE bypass the buffer and directly access the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you access a record that was not yet buffered using SELECT SINGLE, there is a database access to&lt;/P&gt;&lt;P&gt;load the record. If the table does not contain a record with the specified key, this record is recorded in&lt;/P&gt;&lt;P&gt;the buffer as non-existent. This prevents a further database access if you make another access with the&lt;/P&gt;&lt;P&gt;same key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this helps, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 05:54:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-querry-bypassing-buffer/m-p/3510079#M844244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T05:54:29Z</dc:date>
    </item>
  </channel>
</rss>

