-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-5.0This bug affects 5.0.x versions.This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.0affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.2affects-6.3affects-6.4affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-6.6affects-7.0component/statisticsseverity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Start a v4.0.15 cluster
use test;
create table t(a int, b int);
-- insert some rows and wait for stats delta dump
Get stats json file test_t_stats.json
through http api.
{
"database_name": "test",
"table_name": "t",
"columns": {
"a": {
"histogram": {
"ndv": 0
},
"cm_sketch": null,
"null_count": 0,
"tot_col_size": 256,
"last_update_version": 440718415728738305,
"correlation": 0
},
"b": {
"histogram": {
"ndv": 0
},
"cm_sketch": null,
"null_count": 0,
"tot_col_size": 256,
"last_update_version": 440718415728738305,
"correlation": 0
}
},
"indices": {},
"count": 256,
"modify_count": 256,
"partitions": null
}
Start a v6.5.1 cluster
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> load stats 'test_t_stats.json';
Query OK, 0 rows affected (0.36 sec)
mysql> show stats_meta;
+---------+------------+----------------+---------------------+--------------+-----------+
| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count |
+---------+------------+----------------+---------------------+--------------+-----------+
| test | t | | 2023-04-11 18:11:23 | 256 | 256 |
+---------+------------+----------------+---------------------+--------------+-----------+
1 row in set (0.10 sec)
mysql> show stats_histograms;
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+-------------+-----------------+----------------+----------------+---------------+
| Db_name | Table_name | Partition_name | Column_name | Is_index | Update_time | Distinct_count | Null_count | Avg_col_size | Correlation | Load_status | Total_mem_usage | Hist_mem_usage | Topn_mem_usage | Cms_mem_usage |
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+-------------+-----------------+----------------+----------------+---------------+
| test | t | | a | 0 | 2023-04-11 18:11:22 | 0 | 0 | 1 | 0 | allEvicted | 0 | 0 | 0 | 0 |
| test | t | | b | 0 | 2023-04-11 18:11:23 | 0 | 0 | 1 | 0 | allEvicted | 0 | 0 | 0 | 0 |
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+-------------+-----------------+----------------+----------------+---------------+
2 rows in set (0.00 sec)
2. What did you expect to see? (Required)
Since no stats are collected, columns a
and b
should not appear in show stats_histograms
.
3. What did you see instead (Required)
Since no stats are collected, columns a
and b
appear in show stats_histograms
and their status is allEvicted
.
4. What is your TiDB version? (Required)
v6.5.1
Metadata
Metadata
Assignees
Labels
affects-5.0This bug affects 5.0.x versions.This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.0affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.2affects-6.3affects-6.4affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-6.6affects-7.0component/statisticsseverity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.