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

planner: Columns in string pruning (#32626) #32721

Merged
merged 8 commits into from
Mar 8, 2022

Conversation

mjonss
Copy link
Contributor

@mjonss mjonss commented Mar 1, 2022

What problem does this PR solve?

Issue Number: close #32626

Problem Summary:

What is changed and how it works?

Only int and time type of columns was enabled to prune partitions in RANGE COLUMNS IN conditions.

This also enables String type columns

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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

Enable partition pruning for RANGE COLUMNS partitioning on IN conditions and string type columns

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 1, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hawkingrei
  • wjhuang2016

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 1, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Mar 1, 2022

@mjonss
Copy link
Contributor Author

mjonss commented Mar 1, 2022

/run-unit-test

planner/core/partition_pruner_test.go Outdated Show resolved Hide resolved
{sql: `explain select * from t where a = 'AB'`, partitions: "pccc"},
{sql: `explain select * from t where a = 'aB'`, partitions: "pccc"},
{sql: `explain select * from t where a = '🍣'`, partitions: "psushi"},
{sql: `explain select * from t where a in ('🍣 is life', "Räkmacka", "🍺🍺🍺🍺 after work?")`, partitions: "pshrimpsandwich,psushi,pmax"},
Copy link
Member

Choose a reason for hiding this comment

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

Could you add some tests for explicit collate:
such as : explain select * from t where a = 'AA' collate utf8mb4_bin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I found issue #32749 due to this :)
I have added tests for explicit collate as well as for the original bug.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 8, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 8, 2022
@bb7133
Copy link
Member

bb7133 commented Mar 8, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 072426a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 8, 2022
@ti-chi-bot ti-chi-bot merged commit 7bf5e4e into pingcap:master Mar 8, 2022
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 8, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #32921

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 8, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #32923

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 8, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.1 in PR #32924

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 8, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.2 in PR #32925

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 8, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.3 in PR #32926

@ti-srebot
Copy link
Contributor

cherry pick to release-5.4 in PR #32927

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 8, 2022
@mjonss mjonss deleted the columns-in-string-pruning branch March 9, 2022 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.0 needs-cherry-pick-release-5.1 needs-cherry-pick-release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

about RANGE COLUMNS partitioning:partition clipping does not take effect
7 participants