statistics: `analyze table t with 1 buckets` have a logic problem
Open
component/statistics
contribution
severity/moderate
sig/planner
type/bug
- 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)
```
set tidb_analyze_version = 1;
drop table if exists t;
create table t (a int, b int, c int, index aidx(a));
insert into t values(1,1,1),(1,1,1),(1,1,1),(1,1,1),(1,1,1),(2,2,2),(2,2,2),(2,2,2),(2,2,2),(2,2,2);
analyze table t with 1 buckets;
select * from t where a > 1;
show stats_buckets where table_name = "t" and column_name = "aidx";
```
### 2. What did you expect to see? (Required)
the index's histogram should only have a bucket.
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
Contributor guide
Assessment
This issue has not been assessed yet.