|
page_no_t | BUF_READ_AHEAD_RANDOM_THRESHOLD (const buf_pool_t *b) |
| There must be at least this many pages in buf_pool in the area to start a random read-ahead. More...
|
|
ulint | buf_read_page_low (dberr_t *err, bool sync, ulint type, ulint mode, const page_id_t &page_id, const page_size_t &page_size, bool unzip) |
| Low-level function which reads a page asynchronously from a file to the buffer buf_pool if it is not already there, in which case does nothing. More...
|
|
ulint | buf_read_ahead_random (const page_id_t &page_id, const page_size_t &page_size, bool inside_ibuf) |
| Applies a random read-ahead in buf_pool if there are at least a threshold value of accessed pages from the random read-ahead area. More...
|
|
bool | buf_read_page (const page_id_t &page_id, const page_size_t &page_size) |
| High-level function which reads a page asynchronously from a file to the buffer buf_pool if it is not already there. More...
|
|
bool | buf_read_page_background (const page_id_t &page_id, const page_size_t &page_size, bool sync) |
| High-level function which reads a page asynchronously from a file to the buffer buf_pool if it is not already there. More...
|
|
ulint | buf_read_ahead_linear (const page_id_t &page_id, const page_size_t &page_size, bool inside_ibuf) |
| Applies linear read-ahead if in the buf_pool the page is a border page of a linear read-ahead area and all the pages in the area have been accessed. More...
|
|
void | buf_read_ibuf_merge_pages (bool sync, const space_id_t *space_ids, const page_no_t *page_nos, ulint n_stored) |
| Issues read requests for pages which the ibuf module wants to read in, in order to contract the insert buffer tree. More...
|
|
void | buf_read_recv_pages (bool sync, space_id_t space_id, const page_no_t *page_nos, ulint n_stored) |
| Issues read requests for pages which recovery wants to read in. More...
|
|
The database buffer read.
Created 11/5/1995 Heikki Tuuri
Applies linear read-ahead if in the buf_pool the page is a border page of a linear read-ahead area and all the pages in the area have been accessed.
Does not read any page if the read-ahead mechanism is not activated. Note that the algorithm looks at the 'natural' adjacent successor and predecessor of the page, which on the leaf level of a B-tree are the next and previous page in the chain of leaves. To know these, the page specified in (space, offset) must already be present in the buf_pool. Thus, the natural way to use this function is to call it when a page in the buf_pool is accessed the first time, calling this function just after it has been bufferfixed. NOTE 1: as this function looks at the natural predecessor and successor fields on the page, what happens, if these are not initialized to any sensible value? No problem, before applying read-ahead we check that the area to read is within the span of the space, if not, read-ahead is not applied. An uninitialized value may result in a useless read operation, but only very improbably. NOTE 2: the calling thread may own latches on pages: to avoid deadlocks this function must be written such that it cannot end up waiting for these latches! NOTE 3: the calling thread must want access to the page given: this rule is set to prevent unintended read-aheads performed by ibuf routines, a situation which could result in a deadlock if the OS does not support asynchronous io.
- Parameters
-
[in] | page_id | page id; see NOTE 3 above |
[in] | page_size | page size |
[in] | inside_ibuf | true if we are inside ibuf routine |
- Returns
- number of page read requests issued
Applies a random read-ahead in buf_pool if there are at least a threshold value of accessed pages from the random read-ahead area.
Does not read any page, not even the one at the position (space, offset), if the read-ahead mechanism is not activated. NOTE 1: the calling thread may own latches on pages: to avoid deadlocks this function must be written such that it cannot end up waiting for these latches! NOTE 2: the calling thread must want access to the page given: this rule is set to prevent unintended read-aheads performed by ibuf routines, a situation which could result in a deadlock if the OS does not support asynchronous i/o.
- Parameters
-
[in] | page_id | page id of a page which the current thread wants to access |
[in] | page_size | page size |
[in] | inside_ibuf | true if we are inside ibuf routine |
- Returns
- number of page read requests issued; NOTE that if we read ibuf pages, it may happen that the page at the given page number does not get read even if we return a positive value!