-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
statistics: always tracking predicate columns #54152
statistics: always tracking predicate columns #54152
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #54152 +/- ##
=================================================
- Coverage 72.8354% 55.9384% -16.8971%
=================================================
Files 1520 1640 +120
Lines 434902 605433 +170531
=================================================
+ Hits 316763 338670 +21907
- Misses 98541 243641 +145100
- Partials 19598 23122 +3524
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔢 Self-check (PR reviewed by myself and ready for feedback.)
Tested locally:
mysql> set global tidb_enable_column_tracking = 0
-> ;
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1681 | The 'tidb_enable_column_tracking' variable is deprecated and will be removed in future versions of TiDB. It is always set to 'ON' now. |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select @@tidb_enable_column_tracking;
+-------------------------------+
| @@tidb_enable_column_tracking |
+-------------------------------+
| 1 |
+-------------------------------+
1 row in set (0.00 sec)
use test;
create table t(a int, b int);
select * from mysql.column_stats_usage;
mysql> select * from mysql.column_stats_usage;
+----------+-----------+---------------------+------------------+
| table_id | column_id | last_used_at | last_analyzed_at |
+----------+-----------+---------------------+------------------+
| 104 | 1 | 2024-06-21 14:58:14 | NULL |
+----------+-----------+---------------------+------------------+
1 row in set (0.00 sec)
mysql> select * from mysql.analyze_jobs;
+----+---------------------+--------------+------------+----------------+--------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+----------------+------------+
| id | update_time | table_schema | table_name | partition_name | job_info | processed_rows | start_time | end_time | state | fail_reason | instance | process_id |
+----+---------------------+--------------+------------+----------------+--------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+----------------+------------+
| 1 | 2024-06-21 14:55:13 | test | t | | analyze table all columns with 256 buckets, 100 topn, 1 samplerate | 0 | 2024-06-21 14:55:13 | 2024-06-21 14:55:13 | finished | NULL | 127.0.0.1:4000 | NULL |
+----+---------------------+--------------+------------+----------------+--------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+----------------+------------+
1 row in set (0.00 sec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔢 Self-check (PR reviewed by myself and ready for feedback.)
f0fed12
to
d8601c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔢 Self-check (PR reviewed by myself and ready for feedback.)
/approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, easonn7, fixdb, qw4990 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d8601c9
to
794a650
Compare
/retest |
What problem does this PR solve?
Issue Number: ref #53567
Problem Summary:
What changed and how does it work?
You can find the more detailed design here: #53511
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.