Skip to content

*: re-implement partition pruning for better performance (#14679)#15368

Closed
tiancaiamao wants to merge 5 commits intopingcap:v3.0.11from
tiancaiamao:3.0.11-hotfix
Closed

*: re-implement partition pruning for better performance (#14679)#15368
tiancaiamao wants to merge 5 commits intopingcap:v3.0.11from
tiancaiamao:3.0.11-hotfix

Conversation

@tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Mar 13, 2020

Cherry-pick #14679 to 3.0.11, make range pruning as fast as possible

Before:
79076815 ns/op
22.99% of CPU cost
image

After
251407 ns/op
1.09% of CPU cost
image

@tiancaiamao
Copy link
Contributor Author

PTAL @jackysp

@shenli
Copy link
Member

shenli commented Mar 13, 2020

can you compare it with 3.0.5?

@tiancaiamao
Copy link
Contributor Author

v3.0.5 The bench result of same case is 19620187 ns/op

There is no cost in ParseSimpleExprsWithSchema before #13490, the flame graph is totally different:

image

@tiancaiamao
Copy link
Contributor Author

I have to take a rest, when I wake up I'll continue with it and fix the CI.

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

/run-all-tests tidb-test=br/release-3.0

@tiancaiamao
Copy link
Contributor Author

/run-integration-common-test

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

The CI hang...

@tiancaiamao tiancaiamao reopened this Mar 14, 2020
@jackysp
Copy link
Contributor

jackysp commented Mar 14, 2020

PTAL @lysu @imtbkcat

@jackysp jackysp requested review from imtbkcat and lysu March 14, 2020 03:38
@sykp241095
Copy link
Member

/build

@zyxbest
Copy link

zyxbest commented Mar 14, 2020

/run-all-tests pd=release-3.0 tikv=release-3.0 tidb-test=release-3.0

Expr expression.Expression

// The new range partition pruning
*ForRangePruning
Copy link
Contributor

Choose a reason for hiding this comment

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

this is an optimization that avoids calculate lessThenData every time but doesn't exists in master branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's a TODO here https://github.com/pingcap/tidb/pull/15169/files#diff-0411f48b4045359c9f116ef6a779c3efR331

And another tiny change is lessThanData could be int/uint when I find a CI case fail.

@tiancaiamao
Copy link
Contributor Author

new

what's workload running when capturing this graph? why so many makeUnionAllChildren but maybe we should see partitionRangeForCNFExpr?

https://github.com/pingcap/tidb/pull/15368/files#diff-1b0a7f60f2fea2fa689b1dfda250bc3dR1475

@lysu
Copy link
Contributor

lysu commented Mar 14, 2020

new
what's workload running when capturing this graph? why so many makeUnionAllChildren but maybe we should see partitionRangeForCNFExpr?

https://github.com/pingcap/tidb/pull/15368/files#diff-1b0a7f60f2fea2fa689b1dfda250bc3dR1475

my mistake..- -

@tiancaiamao
Copy link
Contributor Author

/run-all-tests pd=release-3.0 tikv=release-3.0 tidb-test=release-3.0

Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

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

LGTM

@lysu
Copy link
Contributor

lysu commented Mar 14, 2020

LGTM

@zyxbest
Copy link

zyxbest commented Mar 14, 2020

/run-all-tests pd=release-3.0 tikv=release-3.0 tidb-test=release-3.0

@tiancaiamao
Copy link
Contributor Author

Close as I've got the binary, this commit finish its mission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants