Presentation is loading. Please wait.

Presentation is loading. Please wait.

CHAPTER 15. QUERY EXECUTIOIN Parin Shah (ID : 207)

Similar presentations


Presentation on theme: "CHAPTER 15. QUERY EXECUTIOIN Parin Shah (ID : 207)"— Presentation transcript:

1 CHAPTER 15. QUERY EXECUTIOIN Parin Shah (ID : 207)

2 Buffer Management It is our assumption that operators on relations have available some number M of main-memory buffers that they can use to store needed data. However these buffers are rarely allocated in advance to the operator, and the value of M may vary depending on system conditions. The central task of making main-memory buffers available to processes, such as queries, that act on the database is given to the buffer manager. It is the responsibility of the buffer manager to allow processes to get the memory they need, while minimizing the delay and unsatisfiable requests.

3 The role of the buffer manager

4 Buffer Management Strategies Least-Recently Used (LRU) First-In-First-Out (FIFO) The "Clock" Algorithm ("Second Chance") System Control

5 The Relationship Between Physical Operator Selection and Buffer Management The query optimizer will select a set of physical operators that will be used to execute a given query. This selection of operators may assume that a certain number of buffers M is available for execution of each of these operators.

6 The Relationship Between Physical Operator Selection and Buffer Management However, as we have seen, the buffer manager may not be willing or able to guarantee the availability of these M buffers when the query is executed. There are thus two related questions to ask about the physical operators: – Can the algorithm adapt to changes in the value of M, the number of main-memory buffers available? – When the expected M buffers are not available, and some blocks that are expected to be in memory have actually been moved to disk by the buffer manager, how does the buffer-replacement strategy used by the buffer manager impact the number of additional I/O's that must be performed?

7 Algorithms Using More Than Two Passes Multipass Sort-Based Algorithms Performance of Multipass, Sort-Based Algorithms Multipass Hash-Based Algorithms Performance of Multipass Hash-Based Algorithms


Download ppt "CHAPTER 15. QUERY EXECUTIOIN Parin Shah (ID : 207)"

Similar presentations


Ads by Google