1 / 14

CS 257 Database Systems Principles Assignment 2

CS 257 Database Systems Principles Assignment 2. Instructor: Student: Dr. T. Y. Lin Rajan Vyas (119). Buffer Management. What does a buffer manager do?. Central Task of making memory buffers available to processors is done with the help of buffer managers. In practice:

hoshi
Download Presentation

CS 257 Database Systems Principles Assignment 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 257Database Systems PrinciplesAssignment 2 Instructor:Student: Dr. T. Y. Lin RajanVyas (119)

  2. Buffer Management

  3. What does a buffer manager do? • Central Task of making memory buffers available to processors is done with the help of buffer managers. • In practice: • rarely allocated in advance • the value of M may vary depending on system conditions • Therefore, buffer manager is used to allow processes to get the memory they need, while minimizing the delay and unclassifiable requests.

  4. Introduction • Buffer Manager manages the required memory for the process with minimum delay. Read/Write Buffers Request

  5. Buffer Management Architecture

  6. Two types of architecture: • Buffer Manager controls main memory directly • Buffer Manager allocates buffer in Virtual Memory • In Each method, the Buffer Manager should limit the number of buffers in use which fit in the available main memory. • When Buffer Manager controls the main memory directly, it selects the buffer to empty by returning its content to disk. If it fails, it may simply be erased from main memory. • If all the buffers are really in use then very little useful works gets done.

  7. Buffer Management Strategies

  8. Buffer-replacement strategies: • Critical choice the buffer manager has to make is when a buffer is needed for a newly requested block and the buffer pool is full then which block to throw out the buffer pool.

  9. LRU (Least Recent Used) It makes buffer free from the block that has not been read or write for the longest time. • FIFO(First In First Out) It makes buffer free that has been occupied the longest and assigned to new request. • The “Clock” Algorithm 0 0 1 1 0 0 1 1

  10. The Relationship Between Physical OperatorSelection and Buffer Management

  11. The query optimizer will eventually select a set of physical operators that will be used to execute a given query. • the buffer manager may not be able to guarantee the availability of the buffers when the query is executed.

  12. Other Algorithms and M buffers Other Algorithms also are impact by M and the buffer-replacement strategy. • Sort-based algorithm • If we use a sort-based algorithm for some operator, then it is possible to adapt to changes in M. • If Af shrinks, we can change the size of a sublist, • since the sort-based algorithms we discussed do not depend on the sublists being the same size. The major limitation is that as M shrinks, • we could be forced to create so many sublists that we cannot then • allocate a buffer for each sublist in the merging process.. • Hash-based algorithm If M shrinks, we can reduce the number of buckets, as long as the buckets still can fit in M buffers.

  13. Hash Table • If the algorithm is hash-based, ive can reduce the number of buckets if • shrinks, as long as the buckets do not then become so large that they do • not fit in allotted main memory. However, unlike sort-based algorithms, • we cannot respond to changes in A1 while the algorithm runs. Rather, • once the number of buckets is chosen, it remains fixed throughout the first • pass, and if buffers become unavailable, the blocks belonging to some of • the buckets will have to be ST\-appedout.

  14. Thank You

More Related