[MDEV-14952] Avoid repeated calls to btr_get_search_latch() Created: 2018-01-15  Updated: 2018-01-16  Resolved: 2018-01-15

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2.2
Fix Version/s: 10.3.4

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: performance, upstream

Issue Links:
Relates
relates to MDEV-14441 InnoDB hangs when setting innodb_adap... Closed

 Description   

The MySQL 5.7 implementation of the parameter adaptive_hash_index_parts introduced a large number of calls to the function btr_get_search_latch(). The adaptive hash index bucket of a particular B-tree index is constant; therefore we should avoid recomputing the hash bucket, especially when calling btr_search_x_lock(index) and btr_search_x_unlock(index) in the same function.

It is better to cache the result of btr_get_search_latch() in a local variable and to pass that as parameter to certain functions.


Generated at Thu Feb 08 08:17:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.