analyze predicate column may not get stat info
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
``` SQL
CREATE TABLE `tlc7a7bc3f` (
`col_32` char(68) COLLATE gbk_bin DEFAULT 'LLQFjN0Ne7',
`col_33` tinyint(1) NOT NULL DEFAULT '1',
`col_34` timestamp NULL DEFAULT NULL,
`col_35` mediumint(8) unsigned NOT NULL DEFAULT '1',
`col_36` binary(79) NOT NULL DEFAULT '3I!s=Kqnf@=7-\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'
) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_bin;
CREATE TABLE `tl4f97ac94` (
`col_1` double DEFAULT '8548.501650392927',
`col_2` char(158) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '=I#8%wzce2DpvHr6YZB',
`col_3` float NOT NULL,
`col_4` varbinary(395) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci;
select /*+ inl_join( tlc7a7bc3f ) */ tlc7a7bc3f.col_32 as r0 from tl4f97ac94 , tlc7a7bc3f where not( tlc7a7bc3f.col_35 in ( 15972450 ,2442965 ,13628873 ,8863316 ,12230202;
) ) order by r0;
dump column usges to mysql.column_stats_usage
analyze table tl4f97ac94 predicate column;
desc select /*+ inl_join( tlc7a7bc3f ) */ tlc7a7bc3f.col_32 as r0 from tl4f97ac94 , tlc7a7bc3f where not( tlc7a7bc3f.col_35 in ( 15972450 ,2442965 ,13628873 ,8863316 ,12230202;
```
### 2. What did you expect to see? (Required)
estRows for tl4f97ac94 is correct.
### 3. What did you see instead (Required)
```
TableFullScan_18 | 10000.00 | cop[tikv] | table:tl4f97ac94
```
### 4. What is your TiDB version? (Required)
master
Contributor guide
Assessment
This issue has not been assessed yet.