mariadb/storage/innobase/buf
Marko Mäkelä f074223ae7 MDEV-32068 Some calls to buf_read_ahead_linear() seem to be useless
The linear read-ahead (enabled by nonzero innodb_read_ahead_threshold)
works best if index leaf pages or undo log pages have been allocated
on adjacent page numbers. The read-ahead is assumed not to be helpful
in other types of page accesses, such as non-leaf index pages.

buf_page_get_low(): Do not invoke buf_page_t::set_accessed(),
buf_page_make_young_if_needed(), or buf_read_ahead_linear().
We will invoke them in those callers of buf_page_get_gen() or
buf_page_get() where it makes sense: the access is not
one-time-on-startup and the page and not going to be freed soon.

btr_copy_blob_prefix(), btr_pcur_move_to_next_page(),
trx_undo_get_prev_rec_from_prev_page(),
trx_undo_get_first_rec(), btr_cur_t::search_leaf(),
btr_cur_t::open_leaf(): Invoke buf_read_ahead_linear().

We will not invoke linear read-ahead in functions that would
essentially allocate or free pages, because pages that are
freshly allocated are expected to be initialized by buf_page_create()
and not read from the data file. Likewise, freeing pages should
not involve accessing any sibling pages, except for freeing
singly-linked lists of BLOB pages.

We will not invoke read-ahead in btr_cur_t::pessimistic_search_leaf()
or in a pessimistic operation of btr_cur_t::open_leaf(), because
it is assumed that pessimistic operations should be preceded by
optimistic operations, which should already have invoked read-ahead.

buf_page_make_young_if_needed(): Invoke also buf_page_t::set_accessed()
and return the result.

btr_cur_nonleaf_make_young(): Like buf_page_make_young_if_needed(),
but do not invoke buf_page_t::set_accessed().

Reviewed by: Vladislav Lesin
Tested by: Matthias Leich
2023-12-05 12:31:29 +02:00
..
buf0block_hint.cc MDEV-27058: Reduce the size of buf_block_t and buf_page_t 2021-11-18 17:47:19 +02:00
buf0buddy.cc MDEV-27891: SIGSEGV in InnoDB buffer pool resize 2022-03-07 13:36:18 +11:00
buf0buf.cc MDEV-32068 Some calls to buf_read_ahead_linear() seem to be useless 2023-12-05 12:31:29 +02:00
buf0checksum.cc MDEV-25105 Remove innodb_checksum_algorithm values none,innodb,... 2021-03-11 12:46:18 +02:00
buf0dblwr.cc MDEV-31826 InnoDB may fail to recover after being killed in fil_delete_tablespace() 2023-10-26 15:07:59 +03:00
buf0dump.cc MDEV-32027 Opening all .ibd files on InnoDB startup can be slow 2023-11-17 15:07:51 +02:00
buf0flu.cc Merge 10.5 into 10.6 2023-11-22 16:56:47 +02:00
buf0lru.cc MDEV-32068 Some calls to buf_read_ahead_linear() seem to be useless 2023-12-05 12:31:29 +02:00
buf0rea.cc Merge 10.5 into 10.6 2023-09-14 09:01:15 +03:00