Why do Dbms use their own paging when the operating system already has one?

Asked

Viewed 206 times

8

I’m studying databases and I’ve come to the subject of replacing pages like LRU and MRU. The operating system already does this normally, because DB needs to make its own paging?

  • Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?

1 answer

10


Because the goals are different. The operating system creates pages of bytes, the database creates pages of data with specific purpose. He knows better what is in there, his pages have a specific format, so much so that it is common that not all pages are equal, each type of page has a specific data structure. It needs to have more control of how they are handled. Overall it is optimized for performance.

OS usually uses a not very efficient linked list for the database access standard.

  • Of course, unless DB goes over filesystem (was common, today is no longer), it also uses the OS pagination at a lower level. A DB page can take up multiple OS pages or an OS page can contain multiple DB pages, depending on what is best for each situation.

    There are banks that use OS paging primarily. Those who chose to have a pagination of their own needed an extra level of control over their memory. Has a more appropriate substitution algorithm (MRU, LRU, LRU-k, etc.). The database algorithm knows what should be active and can prioritize what is most important for that case (indexes, especially primary, need to be available with priority). Remembering that OS pagination continues to be used to compose DB pages.

    In general the disk pages match the memory pages in the case of DB. Since they may be of different sizes than what is used in OS (to suit the access standard), it makes sense to have a self-control.

    There are banks that prefer to leave the pages cache entirely on account of OS, others use both levels. This can even make it difficult to optimize memory consumption, since the data is in two different locations, but can give more security and flexibility.

  • Depending on the implementation of DB it is not possible to manipulate directly on the OS pages. It is not always necessary to manipulate the data that OS can play on disk. Each implementation has its specificity and will manipulate it in the way it is most appropriate. DB needs to decide on its own what should go to "disk" or not.

  • With a more specialized algorithm it is possible to achieve more performance and scalability, as well as more flexibility and reliability.

  • With its own system it is possible to abstract the conditions of the various operating systems. And can adapt when a condition no longer meets expectations and needs.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.