Buffer Pools in DB2
Buffer Pools in DB2
- A buffer pool is an memory area in RAM where data is being read, write and stored for processing during transaction.
- Its the most important component from database performance point of view.( Its like more RAM faster is the PC, similarly larger the bufferpool size better is the performance of Database)
- After an select query is fired, data from the database(located in the HDD) is loaded into the RAM(Bufferpool). This loading of data doesn't not take place row by row, it takes place page by page.
- A page is the smallest unit used for memory transfer from HDD to RAM.
- DB2 supports 4K,8K,16K and 32K size of pages.
- Bufferpool acts as an container for this pages. As per the database configuration, if database is using only 4K size pages then only one bufferpool is required but if database is configured with data of different size pages then we required bufferpools of those sizes.
- All kinds of data from database needs to be loaded into the bufferpool for processing except for
- LONG data
- Large Objects
- Size of Page is decided on the basis of size of rows in the database tables, as a single page can store upto 255 rows at max.
- By default, a 4K buffer pool called “IBMDEFAULTBP” is created upon creation of a new database.
- Following are the commands for creating and managing bufferpools.
- CREATE BUFFERPOOL BP16K SIZE 1000 PAGESIZE16K
- ALTER BUFFERPOOL BP16K SIZE 2000
- DROP BUFFERPOOL BP16K
No comments:
Post a Comment