Skip to content

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

Merged
sopel39 merged 2 commits intotrinodb:masterfrom
lzeiming:meta-cache
Apr 16, 2021
Merged

Add operator cache and coercion cache to reduce planning time#7556
sopel39 merged 2 commits intotrinodb:masterfrom
lzeiming:meta-cache

Conversation

@lzeiming
Copy link
Copy Markdown
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
@findepi findepi requested review from dain, martint and sopel39 April 12, 2021 07:49
@martint
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

sopel39 commented Apr 16, 2021

merged, thanks!

@sopel39 sopel39 mentioned this pull request Apr 16, 2021
9 tasks
@lzeiming lzeiming deleted the meta-cache branch April 16, 2021 08:55
@martint martint added this to the 356 milestone Apr 26, 2021
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