-
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
sessionctx: add tidb_analyze_column_options global variable #54200
sessionctx: add tidb_analyze_column_options global variable #54200
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #54200 +/- ##
=================================================
- Coverage 72.8470% 56.4010% -16.4461%
=================================================
Files 1520 1641 +121
Lines 435106 608395 +173289
=================================================
+ Hits 316962 343141 +26179
- Misses 98555 241903 +143348
- Partials 19589 23351 +3762
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Tested locally:
mysql> select @@tidb_analyze_default_column_choice;
+--------------------------------------+
| @@tidb_analyze_default_column_choice |
+--------------------------------------+
| ALL |
+--------------------------------------+
1 row in set (0.01 sec)
mysql> set global tidb_analyze_default_column_choice = 'predicate'
-> ;
Query OK, 0 rows affected (0.02 sec)
mysql> select @@tidb_analyze_default_column_choice;
+--------------------------------------+
| @@tidb_analyze_default_column_choice |
+--------------------------------------+
| PREDICATE |
+--------------------------------------+
1 row in set (0.00 sec)
mysql> set global tidb_analyze_default_column_choice = 'ALL';
Query OK, 0 rows affected (0.01 sec)
mysql> select @@tidb_analyze_default_column_choice;
+--------------------------------------+
| @@tidb_analyze_default_column_choice |
+--------------------------------------+
| ALL |
+--------------------------------------+
1 row in set (0.00 sec)
mysql> set global tidb_analyze_default_column_choice = 'unkown';
ERROR 1105 (HY000): invalid value for tidb_analyze_default_column_choice, it should be either 'ALL' or 'PREDICATE' |
/retest |
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.)
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.
LGTM
/retest |
[LGTM Timeline notifier]Timeline:
|
test: add tests for tidb_analyze_default_column_choice feat: support lower case chore: make lint happy fix: better comment fix: better comment fix: better comment fix: better comment fix: better name Signed-off-by: hi-rustin <[email protected]>
6b2dc3f
to
ba5d491
Compare
Signed-off-by: hi-rustin <[email protected]>
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 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: easonn7, elsa0520, time-and-fate 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 |
/retest |
What problem does this PR solve?
Issue Number: ref #53567
Problem Summary:
We need to introduce a new global variable to control which columns we need to analyze during the auto-analyze and manual analyze.
Users can set this variable to ALL or PREDICATE to analyze all columns or only predicate columns. The default value will be PREDICATE after this feature is fully implemented.
What changed and how does it work?
tidb_analyze_column_options
.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.