本帖最后由 vatebur 于 2024-2-28 18:26 编辑
表数据1千万条,以下方法都试过了,information_schema.tables里的行数还是不对(7百万)
1.optimize table
2.ANALYZE TABLE
3.innodb_stats_on_metadata + SELECT count(*)
4. information_schema_stats_expiry
error_log里没看到相关的日志
- CREATE TABLE `ds_test_table` (
- `A0` bigint NOT NULL,
- `A1` double DEFAULT NULL,
- `A2` decimal(40,0) DEFAULT NULL,
- `A3` double DEFAULT NULL,
- `A4` decimal(5,2) DEFAULT NULL,
- `A5` smallint DEFAULT NULL,
- `A6` int DEFAULT NULL,
- `A7` bigint DEFAULT NULL,
- `A8` decimal(19,0) DEFAULT NULL,
- `A9` decimal(38,0) DEFAULT NULL,
- `A10` decimal(40,0) DEFAULT NULL,
- `A11` datetime DEFAULT NULL,
- `A12` datetime(6) DEFAULT NULL,
- `A13` datetime DEFAULT NULL,
- `A14` datetime(3) DEFAULT NULL,
- `A15` datetime(6) DEFAULT NULL,
- `A17` char(1) COLLATE utf8mb4_bin DEFAULT NULL,
- `A18` char(1) COLLATE utf8mb4_bin DEFAULT NULL,
- `A19` char(255) COLLATE utf8mb4_bin DEFAULT NULL,
- `A20` varchar(1000) COLLATE utf8mb4_bin DEFAULT NULL,
- `A21` varchar(1) COLLATE utf8mb4_bin DEFAULT NULL,
- `A22` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
- `A23` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
- `A24` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL,
- `A25` varchar(300) COLLATE utf8mb4_bin DEFAULT NULL,
- `A26` varchar(400) COLLATE utf8mb4_bin DEFAULT NULL,
- `A27` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL,
- `A28` varchar(600) COLLATE utf8mb4_bin DEFAULT NULL,
- `A29` varchar(1000) COLLATE utf8mb4_bin DEFAULT NULL,
- PRIMARY KEY (`A0`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
复制代码
|