Every time you run a query, your database has to read data. That data lives on disk — and a random disk read can take 10 milliseconds, while reading the same byte from RAM takes 100 nanoseconds. That is a factor of 100,000.
The buffer pool is the database's answer to this gap. It is a fixed region of RAM that holds recently used pages (the fixed-size blocks that databases use to organize data on disk). When a query needs a page, the engine checks the buffer pool first. A cache hit costs nothing; a cache miss pays the full disk penalty.
The hard question is: when the pool is full and a new page must load, which page do you throw out? Evict the wrong one — one that the next query needs — and you've just manufactured an extra disk read. The answer shapes the performance of every database engine you have ever used.
Comments
Loading comments...