mariadb/storage
Marko Mäkelä 3cdbcc69dd MDEV-32067 InnoDB linear read ahead had better be logical
The linear read-ahead, which is enabled by default by a
nonzero default value of innodb_read_ahead_threshold=56,
only works if index leaf pages or undo log pages have been
allocated on adjacent page numbers. That is not always the case.

After this change, the exact nonzero values of
innodb_read_ahead_threshold matter only for the read-ahead of
undo log pages. For the read-ahead of B-tree leaf pages when
starting a read from an index, it only matters if
innodb_read_ahead_threshold=0.

buf_read_ahead_undo(): Renamed from buf_read_ahead_linear().
This function will no longer be invoked on any BLOB pages
(for which FIL_PAGE_PREV and FIL_PAGE_NEXT were not initialized
consistently) nor on any index pages. For index leaf pages,
we will introduce buf_read_ahead_one() and buf_read_ahead_pages().

btr_cur_t::search_leaf(), btr_cur_t::open_leaf(): Implement
read-ahead for up to 16 leaf-level B-tree pages. This logic
is enabled by a nonzero value of innodb_read_ahead_threshold;
the actual value will not matter here.

buf_read_ahead_update(), buf_read_ahead_update_sql(): Some common code
for updating counters.

buf_read_ahead_one(): Read ahead one (sibling leaf) page.
This logic cannot be disabled.

buf_read_ahead_pages(): Read ahead B-tree index leaf pages.

buf_read_ahead_random(): Split the function into two parts: one
that determines which range of pages should be read, and another
that actually initiates a read of the pages.

buf_read_page_low(): Remove a bogus comment.

btr_pcur_move_to_next_page(): Invoke buf_read_ahead_one()
instead of buf_read_ahead_linear().

btr_pcur_move_backward_from_page(): Implement a fast path of
trying to acquire a latch on the previous page without waiting,
and invoke buf_read_ahead_one() on the preceding page, with the
assumption that we may be accessing that page in the near future.

btr_copy_blob_prefix(): Simplify the logic. On other than
ROW_FORMAT=COMPRESSED BLOB pages, the FIL_PAGE_NEXT field is not
meaningfully initialized. The FIL_PAGE_PREV field is not pointing
to anything meaningful either. buf_read_ahead_linear() expects
these to be set meaningfully. Only the non-default setting
innodb_random_read_ahead=ON might be meaningful here.
2025-06-27 17:02:11 +03:00
..
archive Merge 10.5 into 10.6 2024-06-24 13:09:47 +03:00
blackhole MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
columnstore ColumnStore 6.4.10-1 2025-01-29 10:44:18 +01:00
connect Fixed compiler warning from clang in connect/tabxcl.cpp 2025-06-02 14:02:53 +03:00
csv MDEV-34348: Miscellaneous fixes 2024-11-23 08:14:23 -07:00
example MDEV-36729: ha_example::show_func_example is incorrectly defined 2025-05-29 10:10:52 +10:00
federated Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
federatedx MDEV-36341 UBSAN: FederatedX fill_server runtime error: applying non-zero offset to null pointer 2025-04-07 11:04:53 +02:00
heap Merge 10.5 into 10.6 2025-01-20 09:57:37 +02:00
innobase MDEV-32067 InnoDB linear read ahead had better be logical 2025-06-27 17:02:11 +03:00
maria Updated storage/maria/ma_test_big.sh to use aria_ instead of maria_ 2025-06-02 14:02:53 +03:00
mroonga MDEV-34388: Stack overflow on Alpine Linux (postfix) mroonga+asan 2025-05-28 17:07:53 +10:00
myisam MDEV-33675 Assertion(reclength < vreclength) in setup_vcols_for_repair() 2025-05-23 14:46:35 +03:00
myisammrg Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
oqgraph Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
perfschema MDEV-34388: Stack overflow on Alpine Linux 2025-05-20 17:27:05 +03:00
rocksdb MDEV-34388: Stack overflow on Alpine Linux 2025-05-20 17:27:05 +03:00
sequence MDEV-33746 Supply missing override markings 2024-06-20 11:32:13 -04:00
sphinx Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
spider MDEV-34388: Stack overflow on Alpine Linux 2025-05-20 17:27:05 +03:00
test_sql_discovery Merge 10.5 into 10.6 2024-06-24 13:09:47 +03:00