当我插入数据时,写入器数据库索引统计信息会更新。
但是,Reader DB Indices 统计信息未更新。
样品在这里。
数据库。
create database test;
桌子。
CREATE TABLE test(
test_id INT NOT NULL PRIMARY KEY,
test_txt CHAR(8) DEFAULT NULL,
INDEX test_txt(test_txt)
);
作家。
mysql> insert into test values(1, 'test1');
Query OK, 1 row affected (0.01 sec)
mysql> show index from test;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| test | 0 | PRIMARY | 1 | test_id | A | 1 | NULL | NULL | | BTREE | | |
| test | 1 | test_txt | 1 | test_txt | A | 1 | NULL | NULL | YES | BTREE | | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.00 sec)
读者。
mysql> show index from test;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| test | 0 | PRIMARY | 1 | test_id | A | 0 | NULL | NULL | | BTREE | | |
| test | 1 | test_txt | 1 | test_txt | A | 0 | NULL | NULL | YES | BTREE | | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.00 sec)
为什么基数不只更新阅读器?
参数组是默认的。
请告诉我原因。