-
Notifications
You must be signed in to change notification settings - Fork 6k
planner: use ordered index with is null predicate | tidb-test=pr/2368 #54253
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: use ordered index with is null predicate | tidb-test=pr/2368 #54253
Conversation
Welcome @ari-e! |
Hi @ari-e. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Hi @ari-e. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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-sigs/prow repository. |
/ok-to-test |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #54253 +/- ##
=================================================
- Coverage 74.8413% 55.9786% -18.8628%
=================================================
Files 1555 1676 +121
Lines 363239 609792 +246553
=================================================
+ Hits 271853 341353 +69500
- Misses 71804 245136 +173332
- Partials 19582 23303 +3721
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -148,3 +148,15 @@ func TestRowFunctionMatchTheIndexRangeScan(t *testing.T) { | |||
tk.MustQuery(tt).Sort().Check(testkit.Rows(output[i].Result...)) |
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.
Please run the make bazel_prepare
and upload the changement.
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.
@hawkingrei thanks! unfortunately @ari-e is out for a bit and I don't have permissions to update this PR, so I've addressed the comment separately in #54290
Please ignore this PR and review #54290 instead. |
031c2c5
to
fd9d15a
Compare
9653ec3
to
01a7e18
Compare
/retest |
Picked this PR back up now that I'm back from vacation. So please consider this one and we'll abandon #54290 #54512. I've fixed the unit test failures and bazel build issues. Now the 3 issues left are failed integration tests. I suspect though that these are failing because the plan output is legitimately different with my change. The outputs of those 3 tests are:
@hawkingrei can you provide any guidance for whether these seem like legitimate cases where the integration test needs to be updated, or whether my PR needs to change to not affect these query plans? |
@ari-e LGTM But you should update the result in the for example
|
01a7e18
to
d81df44
Compare
@hawkingrei I fixed the integration test in |
d81df44
to
eb7d420
Compare
/retest |
eb7d420
to
3543c79
Compare
/retest |
@ari-e Please sync code with master. |
/retest |
/test all |
3543c79
to
e71d8f2
Compare
Rebased on master @hawkingrei @winoros |
The |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, winoros 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 |
[LGTM Timeline notifier]Timeline:
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #54188
Problem Summary: Properly classify columns with null predicates (e.g.
WHERE a IS NULL
) as constant so index selection can take advantage of that to satisfy a sort intidb/pkg/planner/core/find_best_task.go
Line 791 in 432bb79
What changed and how does it work?
Added checks for is null predicate during planning and fill corresponding data structures marking that column as a constant.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.