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

Add operator cache and coercion cache to reduce planning time #7556

Merged
merged 2 commits into from
Apr 16, 2021

Conversation

lzeiming
Copy link
Contributor

MetadataManager.resolveOperator() and MetadataManager.getCoercion() are frequently invoked during planning.
Add cache for them could reduce many planning time for IN predicate with a large list.

before the change

Benchmark (stage) Mode Cnt Score Error Units
BenchmarkPlanner.planLargeInQuery optimized avgt 20 17808.872 ± 326.616 ms/op
BenchmarkPlanner.planLargeInQuery created avgt 20 52.415 ± 2.171 ms/op

After the change

Benchmark (stage) Mode Cnt Score Error Units
BenchmarkPlanner.planLargeInQuery optimized avgt 20 5110.045 ± 88.355 ms/op
BenchmarkPlanner.planLargeInQuery created avgt 20 50.761 ± 1.200 ms/op

@cla-bot cla-bot bot added the cla-signed label Apr 12, 2021
@martint
Copy link
Member

martint commented Apr 13, 2021

I think @dain has some pending changes related to this in the work he’s been doing around function system revamp

Copy link
Member

@sopel39 sopel39 left a comment

Choose a reason for hiding this comment

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

lgtm % small comments

MetadataManager.resolveOperator() and MetadataManager.getCoercion() are frequently invoked during planning.
Add cache for them could reduce many planning time for IN predicate with a large list.

before the change
Benchmark (stage) Mode Cnt Score Error Units
BenchmarkPlanner.planLargeInQuery optimized avgt 20 17808.872 ± 326.616 ms/op
BenchmarkPlanner.planLargeInQuery created avgt 20 52.415 ± 2.171 ms/op

After the change
Benchmark (stage) Mode Cnt Score Error Units
BenchmarkPlanner.planLargeInQuery optimized avgt 20 5110.045 ± 88.355 ms/op
BenchmarkPlanner.planLargeInQuery created avgt 20 50.761 ± 1.200 ms/op
@sopel39 sopel39 merged commit 21ec7d4 into trinodb:master Apr 16, 2021
@sopel39
Copy link
Member

sopel39 commented Apr 16, 2021

merged, thanks!

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

Successfully merging this pull request may close these issues.

4 participants