[MDEV-28542] Useless INSERT BUFFER AND ADAPTIVE HASH INDEX output in SHOW ENGINE INNODB STATUS Created: 2022-05-11  Updated: 2022-06-06  Resolved: 2022-06-06

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 10.10.0

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

Issue Links:
Relates
relates to MDEV-21212 buf_page_get_gen -> buf_pool->stat.n_... Closed
relates to MDEV-25882 Statistics used to track b-tree (non-... Closed
relates to MDEV-27734 Set innodb_change_buffering=none by d... Closed

 Description   

Starting with MariaDB Server 10.5.0, the InnoDB adaptive hash index is disabled by default (MDEV-20487).

There are two counters btr_cur_n_non_sea and btr_cur_n_sea that can be used to determine the usefulness of the adaptive hash index. These counters are only exposed via SHOW ENGINE INNODB STATUS, via the section INSERT BUFFER AND ADAPTIVE HASH INDEX, which includes output like this:

	const ulint with_ahi = btr_cur_n_sea, without_ahi = btr_cur_n_non_sea;
	fprintf(file,
		"%.2f hash searches/s, %.2f non-hash searches/s\n",
		static_cast<double>(with_ahi - btr_cur_n_sea_old)
		/ time_elapsed,
		static_cast<double>(without_ahi - btr_cur_n_non_sea_old)
		/ time_elapsed);
	btr_cur_n_sea_old = with_ahi;
	btr_cur_n_non_sea_old = without_ahi;

It does not make any sense to update the counter btr_cur_n_non_sea when the adaptive hash index is disabled. As noted in MDEV-21212, such updates come with a cost.

However, removing the update is a user-visible change, because the above output would show something like the following even when the adaptive hash index is disabled:

0.00 hash searches/s, xxx.xx non-hash searches/s

Therefore, we cannot remove the counter update (or the message output) in any generally available release series.



 Comments   
Comment by Marko Mäkelä [ 2022-05-13 ]

It turns out that the update of the counter btr_cur_n_non_sea was removed already by krunalbauskar in MDEV-25882. An omission of that fix was that the related SHOW ENGINE INNODB STATUS output was not disabled when the adaptive hash index is disabled. That is, we would always report

0.00 hash searches/s, 0.00 non-hash searches/s

In case some user has scripting around the output, we will not remove that message in a GA release, but only in the upcoming MariaDB Server 10.10.

Comment by Marko Mäkelä [ 2022-05-13 ]

As part of this change, I will also hide the INSERT BUFFER section when the change buffer is empty. By default, it should be empty, because the default was changed to innodb_change_buffering=none in MDEV-27734.

Generated at Thu Feb 08 10:01:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.