mariadb/storage/innobase/lock
Marko Mäkelä 4105017a58 MDEV-30357 Performance regression in locking reads from secondary indexes
lock_sec_rec_some_has_impl(): Remove a harmful condition that caused the
performance regression and should not have been added in
commit b6e41e3872 in the first place.
Locking transactions that have not modified any persistent tables
can carry the transaction identifier 0.

trx_t::max_inactive_id: A cache for trx_sys_t::find_same_or_older().
The value is not reset on transaction commit so that previous results
can be reused for subsequent transactions. The smallest active
transaction ID can only increase over time, not decrease.

trx_sys_t::find_same_or_older(): Remember the maximum previous id for which
rw_trx_hash.iterate() returned false, to avoid redundant iterations.

lock_sec_rec_read_check_and_lock(): Add an early return in case we are
already holding a covering table lock.

lock_rec_convert_impl_to_expl(): Add a template parameter to avoid
a redundant run-time check on whether the index is secondary.

lock_rec_convert_impl_to_expl_for_trx(): Move some code from
lock_rec_convert_impl_to_expl(), to reduce code duplication due
to the added template parameter.

Reviewed by: Vladislav Lesin
Tested by: Matthias Leich
2023-03-16 16:00:45 +02:00
..
lock0iter.cc MDEV-20612: Replace lock_sys.mutex with lock_sys.latch 2021-02-11 14:52:10 +02:00
lock0lock.cc MDEV-30357 Performance regression in locking reads from secondary indexes 2023-03-16 16:00:45 +02:00
lock0prdt.cc Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00