Skip to content

Skip system table when collecting prediction columns #53403

@0xPoe

Description

@0xPoe

Bug Report

1. Minimal reproduce step (Required)

  1. Start TiDB cluster: tiup playground v8.0.0

  2. Enable tidb_enable_column_tracking:

mysql> set global tidb_enable_column_tracking=1;
Query OK, 0 rows affected (0.02 sec)

mysql> select @@tidb_enable_column_tracking;
+-------------------------------+
| @@tidb_enable_column_tracking |
+-------------------------------+
|                             1 |
+-------------------------------+
```sql
3. Create a table:
create table t (a int, b int);
4. Select the table:
select * from t where t.a > 1;
5. Wait for about 5m:
```sql
mysql> select * from mysql.column_stats_usage;
+----------+-----------+---------------------+------------------+
| table_id | column_id | last_used_at        | last_analyzed_at |
+----------+-----------+---------------------+------------------+
|      104 |         1 | 2024-04-18 15:59:07 | NULL             |
+----------+-----------+---------------------+------------------+
1 row in set (0.00 sec)
  1. Select a system table:
    select * from mysql.column_stats_usage where column_id > 0;
  2. Wait for another 5m:
mysql> select * from mysql.column_stats_usage;
+----------+-----------+---------------------+------------------+
| table_id | column_id | last_used_at        | last_analyzed_at |
+----------+-----------+---------------------+------------------+
|       54 |         2 | 2024-04-18 16:02:00 | NULL             |
|      104 |         1 | 2024-04-18 15:59:07 | NULL             |
+----------+-----------+---------------------+------------------+
2 rows in set (0.00 sec)
  1. As you can see, we have a new record for the system table: column_stats_usage.

2. What did you expect to see? (Required)

There are no system tables.

3. What did you see instead (Required)

We collected system tables.

4. What is your TiDB version? (Required)

v8.0.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions