[MDEV-7197] different random pages pulled for each index when updating stats Created: 2014-11-25  Updated: 2023-04-11

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Daniel Black Assignee: Marko Mäkelä
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-7084 innodb index stats inadequate using c... Closed
relates to MDEV-7196 ANALYZE TABLE should do complete tabl... Open
relates to MDEV-10338 innodb_stats_traditional Equivalent f... Open

 Description   

storage/xtradb/dict/dict0dict.c:dict_stats_update_transient (ha_innobase::info_low 10.2) iterates over all indexes of a table to update the statistics.

Inside this loop the call to btr_estimate_number_of_different_key_vals fetches a different set of random pages for updating each index.

Since the pages are at random, taking the largest n_sample_pages of pages based on index size and using the same set of pages to calculating the statistics for all indexes will result in less pages retrieved and more accurate statistics (for indexes per table > 1).


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