[MDEV-25882] Statistics used to track b-tree (non-adaptive) searches should be updated only when adaptive hashing is turned-on Created: 2021-06-09 Updated: 2022-05-13 Resolved: 2021-06-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.6.2 |
| Type: | Task | Priority: | Minor |
| Reporter: | Krunal Bauskar | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
Currently, btr_cur_n_non_sea is used to track the search that missed Given a global variable that is updated on each search path it causes Patch moves the said variables inside a loop that is now updated |
| Comments |
| Comment by Marko Mäkelä [ 2021-06-09 ] | ||||||||||||||||||||||||||||||||||||||||
|
That counter is exported as adaptive_hash_non_hash_searches, unless the server is built with cmake -DWITH_INNODB_AHI=OFF to disable all code related to the adaptive hash index:
Maybe we could disable the updates of this counter when the adaptive hash index is disabled? I would think that the difference of these two counters could be interesting, in determining whether the adaptive hash index is useful at all. Do we expect that this counter would be used for any other purpose? Could we do something like this (along with declaring the variable only in cmake -DWITH_INNODB_AHI=ON builds)?
Note: btr_cur_search_to_nth_level_func() is rather low-level function that can be invoked not only during query execution, but also by the purge of history, and by some low-level operations such as restoring a persistent cursor position. The adaptive hash index was disabled by default in | ||||||||||||||||||||||||||||||||||||||||
| Comment by Krunal Bauskar [ 2021-06-09 ] | ||||||||||||||||||||||||||||||||||||||||
|
Marko, Based on our discussion and your suggestion I have revamped the complete patch. Updated patch uploaded to PR and uploading the benchmarking result here. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Krunal Bauskar [ 2021-06-11 ] | ||||||||||||||||||||||||||||||||||||||||
|
Marko, Based on our discussion and taking the approach further we have now moved the said btr_cur_n_non_sea to make it specific only when ahi is enabled. Performance: with AHI enabled effect is clearly seen with 3-9% performance improvement. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-06-11 ] | ||||||||||||||||||||||||||||||||||||||||
|
greenman, please document the user-visible change:
|