Monday, 1 July 2013

Table buffering in SAP - important

Pls refer the belo link:
http://www.sap-perf.ca/sap-table-buffering/

 Which Tables should be Buffered?  Locate the document in its SAP Library structure
Only transparent tables and pooled tables can be buffered. Cluster tables cannot be buffered.
Character data types must be assigned to all key fields of buffered tables, that is the data type of the field must be mapped to one of the ABAP types C, N, D or T (see
Mapping to ABAP Data Types).The following two points speak against table buffering:
  • The data read by the application must always be up-to-date. Delays caused by the synchronization mechanism (see
Synchronization of Local Buffers) cannot be accepted.
  • The table data is frequently modified. In this case the cost of synchronization could be greater than the gain in performance resulting from buffering. Roughly speaking, it does not make sense to buffer a table if more than one percent of the accesses to the table are modifying accesses.

  • The table containing currency exchange rates is updated only once a day, but it is read frequently. Buffering is recommended in this case.
    Typical candidates for buffering include customizing and system tables. In certain cases master data with customizing character can also be buffered.
    The contents of buffered tables are not always up-to-date in a distributed system. You can bypass the buffer and read the data directly from the database table with the ABAP command "SELECT SINGLE ... BYPASSING BUFFER". If a buffered table is accessed frequently with this command, you should consider whether it is really necessary for the table to be buffered or whether it is essential to have the current state of the database.
    You must define whether and how a table is buffered in its technical settings (see
    Technical Settings).



    ***********************************************

    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f244446011d189700000e8322d00/content.htm

    Start of Content Area
    Background documentation Buffering Database Tables  Locate the document in its SAP Library structure
    Buffering a table improves the performance when accessing the data records contained in the table.
    The table buffers reside locally on each application server in the system. The data of buffered tables can thus be accessed directly from the buffer of the application server. This avoids the time-consuming process of accessing the database.
    This graphic is explained in the accompanying text
    Buffering is particularly important in client/server environments, as it takes considerably longer to access a table with the network than it does to access a table that is buffered locally. Depending on the network load, this factor can lie between 10 and 100.
    The difference in performance is somewhat less marked in central systems (systems with only one application server) than in local ones (systems with several application servers). However, even in central systems, a reduction in process changes and increased sophistication of the buffering over that provided by the database system have a noticeable effect on performance.
    How are the Buffers Filled?If a program accesses the data of a buffered table, the database interface determines whether this data is in the buffer of the application server. If this is the case, the data is read directly from the buffer. If the data is not in the buffer of the application server, it is read from the database and loaded into the buffer. The next access to this data can then use the buffer.
    The
    buffering type determines which records are loaded into the buffer during an access.This graphic is explained in the accompanying text
    How are the Local Buffers Synchronized?A buffered table is generally read on all application servers and held in the buffer there. If a program changes the data contained in the table on an application server, this is noted in the log table by the database interface. The buffers still have the old status on all the other application servers, so that the programs might read obsolete data.
    A
    synchronization mechanism runs at a fixed time interval, usually every 1-2 minutes. The log table is read and the buffer contents that were changed by other servers are invalidated. In the next access, the data of invalidated tables is read directly from the database and updated in the buffer.DisplacementIf more space is required in the buffer due to new data, the data that has not been accessed for the longest time is displaced. The data is displaced asynchronously at certain times that are defined dynamically by the buffer accesses. The data is only displaced if at this time the free space in the buffer is less than a given value or if the access quality is not good enough.Resetting the Table BuffersYou can reset the table buffers on the corresponding application servers by entering $TAB in the command field. All the data in the buffer is invalidated.
    Only use this command if inconsistencies occurred in the buffer! It can take several hours to fill the buffers in large systems. Performance is considerably reduced during this time.
    See also:Local Buffer SynchronizationWhich Tables Should be Buffered?
    How are Table Buffers Implemented Technically?
    Which Accesses Proceed Directly to the Database?How can you Analyze the Buffer Quality?

    1 comment: