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

executor,bootstrap: add tidb_index_usage table and cluster_tidb_index_usage table #50824

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Jan 30, 2024

What problem does this PR solve?

Issue Number: close #50823

What changed and how does it work?

  1. Create new tables information_schema.tidb_index_usage + cluster_tidb_index_usage

Check List

Tests

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

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Add new tables `information_schema.tidb_index_usage` and `information_schema.cluster_tidb_index_usage` to show the index usage statistics information.

@ti-chi-bot ti-chi-bot bot added release-note size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 30, 2024
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Merging #50824 (3b7b564) into master (0250675) will increase coverage by 2.3712%.
Report is 46 commits behind head on master.
The diff coverage is 78.8461%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #50824        +/-   ##
================================================
+ Coverage   70.4915%   72.8627%   +2.3712%     
================================================
  Files          1465       1468         +3     
  Lines        433404     441194      +7790     
================================================
+ Hits         305513     321466     +15953     
+ Misses       108645      99655      -8990     
- Partials      19246      20073       +827     
Flag Coverage Δ
integration 49.4901% <0.0000%> (?)
unit 70.2760% <78.8461%> (-0.0188%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 54.2940% <ø> (ø)
parser ∅ <ø> (∅)
br 51.3112% <ø> (+5.5861%) ⬆️

@YangKeao YangKeao changed the title executor,bootstrap: add tidb_index_usage table, cluster_tidb_index_usage table and sys.schema_unused_indexes view executor,bootstrap: add tidb_index_usage table, cluster_tidb_index_usage table and sys.schema_unused_indexes view | tidb-test=pr/2287 Jan 30, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 30, 2024
@YangKeao YangKeao force-pushed the index-usage-table branch 12 times, most recently from f01cf09 to 7dfe820 Compare January 30, 2024 13:59
@YangKeao YangKeao changed the title executor,bootstrap: add tidb_index_usage table, cluster_tidb_index_usage table and sys.schema_unused_indexes view | tidb-test=pr/2287 executor,bootstrap: add tidb_index_usage table, cluster_tidb_index_usage table | tidb-test=pr/2287 Jan 31, 2024
@YangKeao YangKeao changed the title executor,bootstrap: add tidb_index_usage table, cluster_tidb_index_usage table | tidb-test=pr/2287 executor,bootstrap: add tidb_index_usage table, cluster_tidb_index_usage table Jan 31, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 31, 2024
@YangKeao YangKeao force-pushed the index-usage-table branch 2 times, most recently from aa74895 to 95d749e Compare January 31, 2024 05:00
@YangKeao YangKeao changed the title executor,bootstrap: add tidb_index_usage table, cluster_tidb_index_usage table executor,bootstrap: add tidb_index_usage table and cluster_tidb_index_usage table Jan 31, 2024
@YangKeao YangKeao requested a review from bb7133 February 1, 2024 04:21
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Copy link

tiprow bot commented Feb 2, 2024

@YangKeao: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tiprow_fast_test 3b7b564 link true /test tiprow_fast_test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@YangKeao YangKeao requested a review from bb7133 February 2, 2024 06:00
rows := make([][]types.Datum, 0, 100)
checker := privilege.GetPrivilegeManager(ctx)

for _, schema := range schemas {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to consider pushdown predicate to make this InformationSchema table work well when there are a huge number tables. like we do for saas customer: #50779

Copy link
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

Copy link

ti-chi-bot bot commented Feb 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented Feb 4, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-31 08:49:23.893742203 +0000 UTC m=+1555405.458039908: ☑️ agreed by qw4990.
  • 2024-02-04 12:25:55.050358519 +0000 UTC m=+100480.617128401: ☑️ agreed by Benjamin2037.

@ti-chi-bot ti-chi-bot bot merged commit 9a0b6b6 into pingcap:master Feb 4, 2024
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
4 participants