Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip system table when collecting prediction columns #53403

Closed
Rustin170506 opened this issue May 20, 2024 · 0 comments · Fixed by #53443
Closed

Skip system table when collecting prediction columns #53403

Rustin170506 opened this issue May 20, 2024 · 0 comments · Fixed by #53443
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@Rustin170506
Copy link
Member

Rustin170506 commented May 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant