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

plan/executor: make semi joins null and empty aware #9051

Merged
merged 2 commits into from
Feb 25, 2019

Conversation

eurekaka
Copy link
Contributor

What problem does this PR solve?

Fix #8844 and #8642

What is changed and how it works?

  • mark column as operand of in expression, to differentiate column equal condition converted from in expression with other normal column equal conditions;
  • put in expression into OtherConditions of join to make join operators be empty aware;
  • check if null exists in operands of in expression, and determine result of semi joins.

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change
  • Has interface methods change

Side effects

  • Increased code complexity

Related changes

  • Need to cherry-pick to the release branch: let's see if it is easy to cherry-pick and decide later.

@eurekaka eurekaka added status/WIP type/bugfix This PR fixes a bug. sig/planner SIG: Planner sig/execution SIG execution labels Jan 14, 2019
@eurekaka eurekaka force-pushed the in_other_cond branch 2 times, most recently from 7bfa1e0 to 736bd63 Compare January 15, 2019 03:24
@eurekaka
Copy link
Contributor Author

/run-all-tests tidb-test=pr/702

@eurekaka eurekaka changed the title plan/executor: null and empty aware semi joins plan/executor: make semi joins null and empty aware Jan 15, 2019
@eurekaka
Copy link
Contributor Author

/run-all-tests tidb-test=pr/702

@codecov-io
Copy link

codecov-io commented Jan 15, 2019

Codecov Report

Merging #9051 into master will increase coverage by 0.02%.
The diff coverage is 71.15%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #9051      +/-   ##
=========================================
+ Coverage   67.17%   67.2%   +0.02%     
=========================================
  Files         373     373              
  Lines       78386   78450      +64     
=========================================
+ Hits        52658   52724      +66     
- Misses      21007   21008       +1     
+ Partials     4721    4718       -3
Impacted Files Coverage Δ
expression/column.go 77.4% <ø> (ø) ⬆️
executor/executor.go 67.89% <0%> (ø) ⬆️
planner/core/rule_partition_processor.go 74.02% <100%> (ø) ⬆️
planner/core/rule_predicate_push_down.go 89.84% <100%> (+0.68%) ⬆️
planner/core/find_best_task.go 87.9% <100%> (ø) ⬆️
executor/union_scan.go 78.73% <100%> (ø) ⬆️
expression/chunk_executor.go 79.26% <100%> (ø) ⬆️
planner/core/logical_plan_builder.go 74.14% <100%> (ø) ⬆️
executor/merge_join.go 80.85% <100%> (+1.39%) ⬆️
planner/core/rule_eliminate_projection.go 95.83% <100%> (ø) ⬆️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f105b71...49fb0e0. Read the comment docs.

cmd/explaintest/r/explain_easy.result Show resolved Hide resolved
planner/core/rule_predicate_push_down.go Outdated Show resolved Hide resolved
planner/core/logical_plan_builder.go Outdated Show resolved Hide resolved
planner/core/rule_predicate_push_down.go Outdated Show resolved Hide resolved
expression/expression.go Outdated Show resolved Hide resolved
@eurekaka eurekaka requested a review from winoros January 18, 2019 11:41
expression/expression.go Outdated Show resolved Hide resolved
executor/joiner.go Outdated Show resolved Hide resolved
@eurekaka eurekaka requested a review from alivxxx January 24, 2019 06:06
@eurekaka eurekaka force-pushed the in_other_cond branch 6 times, most recently from 735398d to e7aba08 Compare January 31, 2019 08:07
@eurekaka
Copy link
Contributor Author

/run-all-tests tidb-test=pr/702

1 similar comment
@eurekaka
Copy link
Contributor Author

/run-all-tests tidb-test=pr/702

@eurekaka eurekaka requested a review from zz-jason January 31, 2019 08:55
Copy link
Member

@winoros winoros 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

planner/core/expression_rewriter.go Outdated Show resolved Hide resolved
executor/join.go Show resolved Hide resolved
executor/joiner.go Show resolved Hide resolved
executor/joiner.go Show resolved Hide resolved
planner/core/expression_rewriter.go Show resolved Hide resolved
planner/core/expression_rewriter.go Outdated Show resolved Hide resolved
@eurekaka eurekaka requested review from zz-jason and winoros and removed request for zz-jason February 22, 2019 07:55
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 22, 2019
@eurekaka
Copy link
Contributor Author

@winoros PTAL

Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason merged commit 5a283a9 into pingcap:master Feb 25, 2019
@zz-jason zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 25, 2019
@eurekaka eurekaka deleted the in_other_cond branch February 25, 2019 08:13
eurekaka added a commit to eurekaka/tidb that referenced this pull request Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/planner SIG: Planner status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants