tidb icon indicating copy to clipboard operation
tidb copied to clipboard

planner: remove unused parameter and add more comments

Open 0xPoe opened this issue 1 year ago • 3 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

0xPoe avatar Jul 01 '24 03:07 0xPoe

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:

codecov[bot] avatar Jul 01 '24 04:07 codecov[bot]

Tested locally:

  1. Start the TiDB cluster with patch: tiup playground nightly --db.binpath /Volumes/t7/code/tidb/bin/tidb-server
  2. Create a table:
mysql> create table t (a int, b int, c int);
Query OK, 0 rows affected (0.08 sec)
  1. Enable the feature:
mysql> set global tidb_analyze_column_options='PREDICATE';
Query OK, 0 rows affected (0.01 sec)
  1. 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
  1. 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)
  1. Analyze the table:
mysql> analyze table t;
Query OK, 0 rows affected, 2 warnings (0.05 sec)
  1. 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)
  1. 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)

0xPoe avatar Jul 01 '24 09:07 0xPoe

/retest

0xPoe avatar Jul 01 '24 10:07 0xPoe

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ti-chi-bot[bot] avatar Jul 02 '24 07:07 ti-chi-bot[bot]

[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.

ti-chi-bot[bot] avatar Jul 02 '24 07:07 ti-chi-bot[bot]

/retest

0xPoe avatar Jul 02 '24 12:07 0xPoe

/retest

hawkingrei avatar Jul 02 '24 12:07 hawkingrei

/retest

qw4990 avatar Jul 02 '24 12:07 qw4990

/retest

0xPoe avatar Jul 02 '24 13:07 0xPoe

/test all

hawkingrei avatar Jul 02 '24 15:07 hawkingrei

TestAnalyzeMVIndex failed.

hawkingrei avatar Jul 02 '24 15:07 hawkingrei

/retest

0xPoe avatar Jul 03 '24 06:07 0xPoe

/retest

0xPoe avatar Jul 03 '24 07:07 0xPoe

/retest

0xPoe avatar Jul 03 '24 08:07 0xPoe

/retest

0xPoe avatar Jul 03 '24 09:07 0xPoe