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: optimize the performance of decodePlan for big union query (#18891) #18941

Merged
merged 2 commits into from
Aug 3, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #18891 to release-4.0


What problem does this PR solve?

For big query like:

select count(1) as num,a from t1 where a=1 group by a 
union 
select count(1) as num,a from t1 where a=3 group by a;
union 
select count(1) as num,a from t1 where a=5 group by a;
union
... -- many union statement

image

The performance of DecodePlan is bad, this PR try to optimize the performance of it:

For union with 50000 select statements:

--before this PR;

DecodePlan spend 1.35 S

-- this PR:

DecodePlan spend 84.731694ms

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

  • No

Release note

  • optimize the performance of decodePlan for big union query

@ti-srebot
Copy link
Contributor Author

/run-all-tests

Signed-off-by: crazycs520 <[email protected]>
@crazycs520
Copy link
Contributor

/rebuild

@crazycs520 crazycs520 added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Aug 3, 2020
@crazycs520
Copy link
Contributor

/run-all-tests

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 3, 2020
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 3, 2020
@ti-srebot ti-srebot added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Aug 3, 2020
@zz-jason
Copy link
Member

zz-jason commented Aug 3, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 3, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit d363ac6 into pingcap:release-4.0 Aug 3, 2020
@crazycs520 crazycs520 deleted the release-4.0-950ca5062cb9 branch August 3, 2020 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression priority/release-blocker This issue blocks a release. Please solve it ASAP. sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. type/enhancement The issue or PR belongs to an enhancement. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants