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, executor: build ColWithCmpFuncManager.TmpConstant for indexJoin.innerWorker individually #13669

Merged
merged 3 commits into from
Nov 21, 2019

Conversation

XuHuaiyu
Copy link
Contributor

What problem does this PR solve?

Before this commit, the query result is not stable:

drop table if exists t,s
create table t(a int primary key auto_increment, b time)
create table s(a int, b time)
alter table s add index idx(a,b)
set @@tidb_index_join_batch_size=4;set @@tidb_init_chunk_size=1;set @@tidb_max_chunk_size=32; set @@tidb_index_lookup_join_concurrency=15;
-- insert 64 rows into `t`
-- insert 64 rows into `s`
select /*+ TIDB_INLJ(s) */ count(*) from t join s use index(idx) on s.a = t.a and s.b < t.b;

What is changed and how it works?

Build ColWithCmpFuncManager.TmpConstant for indexJoin.innerWorker individually.
Thus the modifications triggered by each inner worker will not affect the others.

Check List

Tests

  • Integration test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change

Side effects

N/A

Related changes

  • Need to cherry-pick to the release branch
    release-3.0

Release note

  • Write release note for bug-fix or new feature.

@codecov
Copy link

codecov bot commented Nov 21, 2019

Codecov Report

Merging #13669 into master will decrease coverage by 0.4844%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #13669        +/-   ##
================================================
- Coverage   80.4178%   79.9334%   -0.4845%     
================================================
  Files           474        473         -1     
  Lines        119767     115909      -3858     
================================================
- Hits          96314      92650      -3664     
+ Misses        16048      15955        -93     
+ Partials       7405       7304       -101

@XuHuaiyu
Copy link
Contributor Author

/run-all-tests

}
tk.MustExec("insert into s select a, b - 1 from t")
tk.MustExec("analyze table t;")
tk.MustExec("analyze table s;")
Copy link
Member

Choose a reason for hiding this comment

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

no need to analyze these tables since we are using hint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noe need. But it can make the test stable.

@XuHuaiyu XuHuaiyu requested a review from zz-jason November 21, 2019 12:37
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

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 status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Nov 21, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 21, 2019

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This issue blocks a release. Please solve it ASAP. sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. 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.

4 participants