MySQL [database_name]> select count(1) as cnt from database_name.dw_std_yf_roomtype_position; +---------+ | cnt | +---------+ | 1247196 | +---------+ 1 row in set (0.20 sec) MySQL [database_name]> select * from mysql.innodb_table_stats where table_name='dw_std_yf_roomtype_position'; +---------------------+-----------------------------+---------------------+--------+----------------------+--------------------------+ | database_name | table_name | last_update | n_rows | clustered_index_size | sum_of_other_index_sizes | +---------------------+-----------------------------+---------------------+--------+----------------------+--------------------------+ | database_name | dw_std_yf_roomtype_position | 2019-08-01 02:07:24 | 0 | 1 | 3 | +---------------------+-----------------------------+---------------------+--------+----------------------+--------------------------+ 1 row in set (0.09 sec) MySQL [database_name]> select * from information_schema.tables where table_schema = 'database_name' and table_name = 'dw_std_yf_roomtype_position'; +---------------+---------------------+-----------------------------+------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------------------------------+--------------+ | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE | ENGINE | VERSION | ROW_FORMAT | TABLE_ROWS | AVG_ROW_LENGTH | DATA_LENGTH | MAX_DATA_LENGTH | INDEX_LENGTH | DATA_FREE | AUTO_INCREMENT | CREATE_TIME | UPDATE_TIME | CHECK_TIME | TABLE_COLLATION | CHECKSUM | CREATE_OPTIONS | TABLE_COMMENT | BLOCK_FORMAT | +---------------+---------------------+-----------------------------+------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------------------------------+--------------+ | def | database_name | dw_std_yf_roomtype_position | BASE TABLE | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 49152 | 4194304 | NULL | 2018-01-25 16:55:06 | NULL | NULL | utf8_general_ci | NULL | | 801002002017_户型的检查部位 | Original | +---------------+---------------------+-----------------------------+------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------------------------------+--------------+ 1 row in set (0.00 sec) MySQL [database_name]> ANALYZE table database_name.dw_std_yf_roomtype_position; +-------------------------------------------------+---------+----------+----------+ | Table | Op | Msg_type | Msg_text | +-------------------------------------------------+---------+----------+----------+ | database_name.dw_std_yf_roomtype_position | analyze | status | OK | +-------------------------------------------------+---------+----------+----------+ 1 row in set (0.07 sec) MySQL [database_name]> select * from mysql.innodb_table_stats where table_name='dw_std_yf_roomtype_position'; +---------------------+-----------------------------+---------------------+---------+----------------------+--------------------------+ | database_name | table_name | last_update | n_rows | clustered_index_size | sum_of_other_index_sizes | +---------------------+-----------------------------+---------------------+---------+----------------------+--------------------------+ | database_name | dw_std_yf_roomtype_position | 2019-08-01 10:56:02 | 1157429 | 32640 | 40192 | +---------------------+-----------------------------+---------------------+---------+----------------------+--------------------------+ 1 row in set (0.10 sec) MySQL [database_name]> select * from information_schema.tables where table_schema = 'database_name' and table_name = 'dw_std_yf_roomtype_position'; +---------------+---------------------+-----------------------------+------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------------------------------+--------------+ | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE | ENGINE | VERSION | ROW_FORMAT | TABLE_ROWS | AVG_ROW_LENGTH | DATA_LENGTH | MAX_DATA_LENGTH | INDEX_LENGTH | DATA_FREE | AUTO_INCREMENT | CREATE_TIME | UPDATE_TIME | CHECK_TIME | TABLE_COLLATION | CHECKSUM | CREATE_OPTIONS | TABLE_COMMENT | BLOCK_FORMAT | +---------------+---------------------+-----------------------------+------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------------------------------+--------------+ | def | database_name | dw_std_yf_roomtype_position | BASE TABLE | InnoDB | 10 | Compact | 1157429 | 462 | 534773760 | 0 | 658505728 | 4194304 | NULL | 2018-01-25 16:55:06 | NULL | NULL | utf8_general_ci | NULL | | 801002002017_户型的检查部位 | Original | +---------------+---------------------+-----------------------------+------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------------------------------+--------------+ 1 row in set (0.00 sec) show index from database_name.dw_std_yf_roomtype_position; MySQL [database_name]> show index from database_name.dw_std_yf_roomtype_position; +-----------------------------+------------+--------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | +-----------------------------+------------+--------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | dw_std_yf_roomtype_position | 0 | PRIMARY | 1 | id | A | 1157429 | NULL | NULL | | BTREE | | | YES | | dw_std_yf_roomtype_position | 0 | PRIMARY | 2 | db_name | A | 1157429 | NULL | NULL | | BTREE | | | YES | | dw_std_yf_roomtype_position | 1 | ix_position_id | 1 | position_id | A | 52610 | NULL | NULL | YES | BTREE | | | YES | | dw_std_yf_roomtype_position | 1 | ix_tenant_roomtype | 1 | roomtype_id | A | 289357 | NULL | NULL | YES | BTREE | | | YES | | dw_std_yf_roomtype_position | 1 | ix_tenant_roomtype | 2 | db_name | A | 289357 | NULL | NULL | | BTREE | | | YES | | dw_std_yf_roomtype_position | 1 | ix_tenant_position | 1 | db_name | A | 12580 | NULL | NULL | | BTREE | | | YES | | dw_std_yf_roomtype_position | 1 | ix_tenant_position | 2 | position_id | A | 44516 | NULL | NULL | YES | BTREE | | | YES | +-----------------------------+------------+--------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
mysql统计信息异常修复
猜你喜欢
转载自www.cnblogs.com/chenzechao/p/11281280.html
今日推荐
周排行