Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't DMBSes rely on the OS buffer pool?

Stonebraker's paper (Operating System Support for Database Management) explains that, "the overhead to fetch a block from the buffer pool manager usually includes that of a system call and a core-to-core move." Forget about the buffer-replacement strategy, etc. The only point I question is the quoted.

My understanding is that when a DBMS wants to read a block x it issues a common read instruction. There should be no difference from that of any other application requesting a read.

I'm not looking for generic answers (I got them, and read papers). I seek a detailed answer of the described problem. See Does a file read from a Java application invoke a system call?

like image 377
simpatico Avatar asked Jul 03 '10 15:07

simpatico


People also ask

What is buffer pool in OS?

The buffer pool is an area in main memory where InnoDB caches table and index data as it is accessed. The buffer pool permits frequently used data to be accessed directly from memory, which speeds up processing.

What is the use of buffer cache in OS?

The buffer cache serializes access to the disk blocks, just as locks serialize access to in- memory data structures. Like the operating system as a whole, the buffer cache's fun- damental purpose is to enable safe cooperation between processes.

What is database buffer pool?

A buffer pool is an area of main memory that has been allocated by the database manager for the purpose of caching table and index data as it is read from disk. Every Db2® database must have a buffer pool.

What is the structure of buffer pool?

Buffer pool is collection of a buffers arrange in series. The kernel caches data in the buffer pool according algorithm called least recently used, after that it allocates a buffer for a disk block, it cannot use the same buffer again for another disk block until all other buffers have been used more recently.


1 Answers

Reading from your other question, and working forward:

When the DBMS must bring a page from disk it will involve at least one system call. At his point most DBMSs place the page into their own buffer. (They also end up in the OS' buffer, but that's unimportant).

So, we have one system call. However, we can avoid any further system calls. This is possible because the DBMS is caching pages in its own memory space. The first thing the DBMS will do when it decides it needs a page is check and see if it has it in its cache. If it does, it retrieves it from there without ever invoking a system call.

The DBMS is free to expire pages in its cache in whatever way is most beneficial for its IO needs. The OS's cache is expired in a more general way since the OS has other things to worry about. One example of this is that a DBMS will typically use a great deal of memory to cache pages as it knows that disk IO is one of the most expensive things it can do. The OS won't do this as it has to balance the cost of disk IO against having memory for other applications to use.

like image 152
Donnie Avatar answered Nov 02 '22 11:11

Donnie