You use single-record buffering to load into the buffer only the records that are actually read. Single-record buffering requires less storage space in the buffer than generic and full buffering. The administrative costs in the buffer are greater than for generic or full buffering. Considerably more database accesses are necessary to load the records than for the other buffering types.
In this example, a program reads the record highlighted in red from table SCOUNTER. If single-record buffering is selected for the table, the system loads into the buffer only the record that is read. This is shown in the figure below.
When To Use Single-Record Buffering
Single-record buffering should be used for tables where only a few records are accessed by specifying the complete key.
Full buffering is more suitable for smaller tables that are accessed frequently. This is because only one database access is necessary to load such a table with full buffering, whereas several database accesses are necessary for single-record buffering.
Access to Buffered Data
All accesses that do not specify the complete key go directly to the database, bypassing the buffer.
If you access a record which is not yet buffered, there is a database access to load the record. The system marks this record in the buffer as nonexistent if the table does not contain a record with the specified key. This prevents another database access when the table is accessed at a later time with the same key.