Bug #111956 Document error: mysql.index_stats should be mysql.innodb_index_stats.
Submitted: 3 Aug 2023 9:57 Modified: 7 Aug 2023 8:04
Reporter: fander chan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0,8.1 OS:Any
Assigned to: CPU Architecture:Any

[3 Aug 2023 9:57] fander chan
Description:
Document error: mysql.index_stats should be mysql.innodb_index_stats.

How to repeat:
mysql> select * from mysql.index_stats;
ERROR 3554 (HY000): Access to data dictionary table 'mysql.index_stats' is rejected.
mysql> select * from mysql.innodb_index_stats;
+---------------+------------+------------+---------------------+--------------+------------+-------------+-----------------------------------+
| database_name | table_name | index_name | last_update         | stat_name    | stat_value | sample_size | stat_description                  |
+---------------+------------+------------+---------------------+--------------+------------+-------------+-----------------------------------+
| mysql         | component  | PRIMARY    | 2023-08-02 17:53:43 | n_diff_pfx01 |          0 |           1 | component_id                      |
| mysql         | component  | PRIMARY    | 2023-08-02 17:53:43 | n_leaf_pages |          1 |        NULL | Number of leaf pages in the index |
| mysql         | component  | PRIMARY    | 2023-08-02 17:53:43 | size         |          1 |        NULL | Number of pages in the index      |
| sys           | sys_config | PRIMARY    | 2023-08-02 17:53:43 | n_diff_pfx01 |          6 |           1 | variable                          |
| sys           | sys_config | PRIMARY    | 2023-08-02 17:53:43 | n_leaf_pages |          1 |        NULL | Number of leaf pages in the index |
| sys           | sys_config | PRIMARY    | 2023-08-02 17:53:43 | size         |          1 |        NULL | Number of pages in the index      |
+---------------+------------+------------+---------------------+--------------+------------+-------------+-----------------------------------+
6 rows in set (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.34    |
+-----------+
1 row in set (0.00 sec)

Suggested fix:
fix it in 
https://dev.mysql.com/doc/refman/8.0/en/information-schema-optimization.html
https://dev.mysql.com/doc/refman/8.1/en/information-schema-optimization.html
[3 Aug 2023 9:59] fander chan
Addendum:
Document error: mysql.table_stats should be mysql.innodb_table_stats.
[3 Aug 2023 10:26] MySQL Verification Team
Hello fander chan,

Thank you for the report and feedback.

regards,
Umesh
[7 Aug 2023 8:04] Stefan Hinz
Posted by developer:
 
It is mysql.innodb_table_stats, not mysql.table_stats. Fixed. Thanks for reporting!