tidb
tidb copied to clipboard
planner: remove unused parameter and add more comments
What problem does this PR solve?
Issue Number: ref https://github.com/pingcap/tidb/issues/53567
Problem Summary:
What changed and how does it work?
- Removed the unused parameter and added more comments
- Distinguished between singular and plural.
- Included the indexes info.
Check List
Tests
- [x] Unit test
- [ ] Integration test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test
- [ ] I checked and no code files have been changed.
Side effects
- [ ] Performance regression: Consumes more CPU
- [ ] Performance regression: Consumes more Memory
- [ ] Breaking backward compatibility
Documentation
- [ ] Affects user behaviors
- [ ] Contains syntax changes
- [ ] Contains variable changes
- [ ] Contains experimental features
- [ ] Changes MySQL compatibility
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
在 analyze_job 中显示分析了的 indexes 信息
Display information about analyzed indexes in analyze_job
Codecov Report
Attention: Patch coverage is 89.09091% with 6 lines in your changes missing coverage. Please review.
Project coverage is 56.2625%. Comparing base (
230bbc2) to head (30d818b). Report is 4 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #54336 +/- ##
=================================================
- Coverage 72.8839% 56.2625% -16.6214%
=================================================
Files 1533 1654 +121
Lines 436132 611098 +174966
=================================================
+ Hits 317870 343819 +25949
- Misses 98667 243782 +145115
- Partials 19595 23497 +3902
| Flag | Coverage Δ | |
|---|---|---|
| integration | 37.5935% <89.0909%> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| dumpling | 52.9656% <ø> (ø) |
|
| parser | ∅ <ø> (∅) |
|
| br | 52.7512% <ø> (+6.6214%) |
:arrow_up: |
Tested locally:
- Start the TiDB cluster with patch:
tiup playground nightly --db.binpath /Volumes/t7/code/tidb/bin/tidb-server - Create a table:
mysql> create table t (a int, b int, c int);
Query OK, 0 rows affected (0.08 sec)
- Enable the feature:
mysql> set global tidb_analyze_column_options='PREDICATE';
Query OK, 0 rows affected (0.01 sec)
- Insert some data:
mysql> insert into t values (1, 1, 1), (2, 2, 2), (3, 3, 3);
Query OK, 3 rows affected (0.01 sec)
Records: 3 Duplicates: 0 Warnings: 0
- Check the stats meta:
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
| 450840965863178242 | 104 | 3 | 3 | 0 |
+--------------------+----------+--------------+-------+----------+
1 row in set (0.00 sec)
- Analyze the table:
mysql> analyze table t;
Query OK, 0 rows affected, 2 warnings (0.05 sec)
- Check the analyze job(no indexes and no columns):
mysql> select table_name, job_info from mysql.analyze_jobs;
+------------+--------------------------------------------------------+
| table_name | job_info |
+------------+--------------------------------------------------------+
| t | analyze table with 256 buckets, 100 topn, 1 samplerate |
+------------+--------------------------------------------------------+
1 row in set (0.00 sec)
- Check the stats_meta:
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+--------------------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+--------------------+
| 450840975760424971 | 104 | 0 | 3 | 450840975747317761 |
+--------------------+----------+--------------+-------+--------------------+
1 row in set (0.00 sec)
/retest
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: elsa0520, hawkingrei
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [elsa0520,hawkingrei]
- ~~pkg/statistics/OWNERS~~ [elsa0520,hawkingrei]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[LGTM Timeline notifier]
Timeline:
2024-07-01 09:44:09.098272849 +0000 UTC m=+1231175.583761681: :ballot_box_with_check: agreed by hawkingrei.2024-07-02 07:38:54.83133113 +0000 UTC m=+1310061.316819962: :ballot_box_with_check: agreed by elsa0520.
/retest
/retest
/retest
/retest
/test all
TestAnalyzeMVIndex failed.
/retest
/retest
/retest
/retest