You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create table t (a int, b int, c int) partition by range (a) (partition p0 values less than (10), partition p1 values less than (20));
insert into t values (1,1,1), (2,2,2), (11,11,11);
set tidb_partition_prune_mode=dynamic;
analyze table t partition p0 columns b with 1 topn, 1 buckets;
analyze table t partition p1 columns c with 1 topn, 1 buckets;
select * from t where b>1 and c>1;
show stats_histograms where table_name like "t";
2. What did you expect to see? (Required)
distinct count should be 3 for both columns b & c
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+
| Db_name | Table_name | Partition_name | Column_name | Is_index | Update_time | Distinct_count | Null_count | Avg_col_size | Correlation |
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+
| test | t | global | b | 0 | 2022-05-17 14:44:33 | 3 | 0 | 8 | 0 |
| test | t | global | c | 0 | 2022-05-17 14:44:33 | 3 | 0 | 8 | 0 |
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+
3. What did you see instead (Required)
distinct count is incorrect for both columns b & c, generate global stats ignoring the missing column stats.
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+
| Db_name | Table_name | Partition_name | Column_name | Is_index | Update_time | Distinct_count | Null_count | Avg_col_size | Correlation |
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+
| test | t | global | b | 0 | 2022-05-17 14:41:52 | 2 | 0 | 17 | 0 |
| test | t | global | c | 0 | 2022-05-17 14:42:39 | 0 | 0 | 10 | 0 |
4. What is your TiDB version? (Required)
v6.0, master
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
distinct count should be 3 for both columns b & c
3. What did you see instead (Required)
distinct count is incorrect for both columns b & c, generate global stats ignoring the missing column stats.
4. What is your TiDB version? (Required)
v6.0, master
The text was updated successfully, but these errors were encountered: