[root@localhost ~]# mysql -V
|
mysql Ver 15.1 Distrib 10.6.9-MariaDB, for Linux (x86_64) using readline 5.1
|
[root@localhost ~]# date
|
Fri Sep 16 08:46:57 CDT 2022
|
[root@localhost ~]# mysql -e 'create database wptest;'
|
[root@localhost ~]# mysql wptest < wptest.sql
|
[root@localhost ~]# mysql wptest -e 'show indexes from wp_options;'
|
+------------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
|
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
|
+------------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
|
| wp_options | 0 | PRIMARY | 1 | option_id | A | 2 | NULL | NULL | | BTREE | | | NO |
|
| wp_options | 0 | option_name | 1 | option_name | A | 2 | NULL | NULL | | BTREE | | | NO |
|
| wp_options | 1 | autoload | 1 | autoload | A | 2 | NULL | NULL | | BTREE | | | NO |
|
+------------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
|
[root@localhost ~]# mysql -e 'select TABLE_ROWS, DATA_LENGTH, INDEX_LENGTH from information_schema.tables where TABLE_SCHEMA = "wptest" and TABLE_NAME = "wp_options";'
|
+------------+-------------+--------------+
|
| TABLE_ROWS | DATA_LENGTH | INDEX_LENGTH |
|
+------------+-------------+--------------+
|
| 2 | 16384 | 32768 |
|
+------------+-------------+--------------+
|
[root@localhost ~]# mysql mysql -e 'select * from innodb_index_stats where database_name="wptest" and table_name="wp_options";'
|
+---------------+------------+-------------+---------------------+--------------+------------+-------------+-----------------------------------+
|
| database_name | table_name | index_name | last_update | stat_name | stat_value | sample_size | stat_description |
|
+---------------+------------+-------------+---------------------+--------------+------------+-------------+-----------------------------------+
|
| wptest | wp_options | PRIMARY | 2022-09-16 08:47:06 | n_diff_pfx01 | 0 | 1 | option_id |
|
| wptest | wp_options | PRIMARY | 2022-09-16 08:47:06 | n_leaf_pages | 1 | NULL | Number of leaf pages in the index |
|
| wptest | wp_options | PRIMARY | 2022-09-16 08:47:06 | size | 1 | NULL | Number of pages in the index |
|
| wptest | wp_options | autoload | 2022-09-16 08:47:06 | n_diff_pfx01 | 0 | 1 | autoload |
|
| wptest | wp_options | autoload | 2022-09-16 08:47:06 | n_diff_pfx02 | 0 | 1 | autoload,option_id |
|
| wptest | wp_options | autoload | 2022-09-16 08:47:06 | n_leaf_pages | 1 | NULL | Number of leaf pages in the index |
|
| wptest | wp_options | autoload | 2022-09-16 08:47:06 | size | 1 | NULL | Number of pages in the index |
|
| wptest | wp_options | option_name | 2022-09-16 08:47:06 | n_diff_pfx01 | 0 | 1 | option_name |
|
| wptest | wp_options | option_name | 2022-09-16 08:47:06 | n_leaf_pages | 1 | NULL | Number of leaf pages in the index |
|
| wptest | wp_options | option_name | 2022-09-16 08:47:06 | size | 1 | NULL | Number of pages in the index |
|
+---------------+------------+-------------+---------------------+--------------+------------+-------------+-----------------------------------+
|
[root@localhost ~]# mysql mysql -e 'select * from innodb_table_stats where database_name="wptest" and table_name="wp_options";'
|
+---------------+------------+---------------------+--------+----------------------+--------------------------+
|
| database_name | table_name | last_update | n_rows | clustered_index_size | sum_of_other_index_sizes |
|
+---------------+------------+---------------------+--------+----------------------+--------------------------+
|
| wptest | wp_options | 2022-09-16 08:47:06 | 2 | 1 | 2 |
|
+---------------+------------+---------------------+--------+----------------------+--------------------------+
|
[root@localhost ~]# mysqlcheck wptest -a
|
wptest.wp_commentmeta OK
|
wptest.wp_comments OK
|
wptest.wp_links OK
|
wptest.wp_options OK
|
wptest.wp_postmeta OK
|
wptest.wp_posts OK
|
wptest.wp_term_relationships OK
|
wptest.wp_term_taxonomy OK
|
wptest.wp_termmeta OK
|
wptest.wp_terms OK
|
wptest.wp_usermeta OK
|
wptest.wp_users OK
|
[root@localhost ~]#
|
[root@localhost ~]#
|
[root@localhost ~]#
|
[root@localhost ~]#
|
[root@localhost ~]#
|
[root@localhost ~]# mysql wptest -e 'show indexes from wp_options;'
|
+------------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
|
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
|
+------------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
|
| wp_options | 0 | PRIMARY | 1 | option_id | A | 120 | NULL | NULL | | BTREE | | | NO |
|
| wp_options | 0 | option_name | 1 | option_name | A | 120 | NULL | NULL | | BTREE | | | NO |
|
| wp_options | 1 | autoload | 1 | autoload | A | 4 | NULL | NULL | | BTREE | | | NO |
|
+------------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
|
[root@localhost ~]# mysql -e 'select TABLE_ROWS, DATA_LENGTH, INDEX_LENGTH from information_schema.tables where TABLE_SCHEMA = "wptest" and TABLE_NAME = "wp_options";'
|
+------------+-------------+--------------+
|
| TABLE_ROWS | DATA_LENGTH | INDEX_LENGTH |
|
+------------+-------------+--------------+
|
| 120 | 1589248 | 32768 |
|
+------------+-------------+--------------+
|
[root@localhost ~]# mysql mysql -e 'select * from innodb_index_stats where database_name="wptest" and table_name="wp_options";'
|
+---------------+------------+-------------+---------------------+--------------+------------+-------------+-----------------------------------+
|
| database_name | table_name | index_name | last_update | stat_name | stat_value | sample_size | stat_description |
|
+---------------+------------+-------------+---------------------+--------------+------------+-------------+-----------------------------------+
|
| wptest | wp_options | PRIMARY | 2022-09-16 08:47:18 | n_diff_pfx01 | 120 | 1 | option_id |
|
| wptest | wp_options | PRIMARY | 2022-09-16 08:47:18 | n_leaf_pages | 1 | NULL | Number of leaf pages in the index |
|
| wptest | wp_options | PRIMARY | 2022-09-16 08:47:18 | size | 97 | NULL | Number of pages in the index |
|
| wptest | wp_options | autoload | 2022-09-16 08:47:18 | n_diff_pfx01 | 2 | 1 | autoload |
|
| wptest | wp_options | autoload | 2022-09-16 08:47:18 | n_diff_pfx02 | 120 | 1 | autoload,option_id |
|
| wptest | wp_options | autoload | 2022-09-16 08:47:18 | n_leaf_pages | 1 | NULL | Number of leaf pages in the index |
|
| wptest | wp_options | autoload | 2022-09-16 08:47:18 | size | 1 | NULL | Number of pages in the index |
|
| wptest | wp_options | option_name | 2022-09-16 08:47:18 | n_diff_pfx01 | 120 | 1 | option_name |
|
| wptest | wp_options | option_name | 2022-09-16 08:47:18 | n_leaf_pages | 1 | NULL | Number of leaf pages in the index |
|
| wptest | wp_options | option_name | 2022-09-16 08:47:18 | size | 1 | NULL | Number of pages in the index |
|
+---------------+------------+-------------+---------------------+--------------+------------+-------------+-----------------------------------+
|
[root@localhost ~]# mysql mysql -e 'select * from innodb_table_stats where database_name="wptest" and table_name="wp_options";'
|
+---------------+------------+---------------------+--------+----------------------+--------------------------+
|
| database_name | table_name | last_update | n_rows | clustered_index_size | sum_of_other_index_sizes |
|
+---------------+------------+---------------------+--------+----------------------+--------------------------+
|
| wptest | wp_options | 2022-09-16 08:47:18 | 120 | 97 | 2 |
|
+---------------+------------+---------------------+--------+----------------------+--------------------------+
|
[root@localhost ~]#
|
Same here. We've upgraded a few months ago to 10.6 and since than we have serious problems.
Exact same behaviour as you stated, after import, weird table stats shown (mostly it reports zero size). Queries however does work, but extremely slow.
We are running those instances on windows 2019 servers.
mysqlcheck -o fixes it, but the problem often reappear after an import, not always.
We've moved servers recently also, with the way of backup and import sql files. This almost killed the server (hanging queries, etc...) because of this issue. Running mysqlcheck after import on all dbs fixed it.