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

feat(query): add plan cache #16333

Merged
merged 21 commits into from
Aug 28, 2024
Merged

feat(query): add plan cache #16333

merged 21 commits into from
Aug 28, 2024

Conversation

sundy-li
Copy link
Member

@sundy-li sundy-li commented Aug 26, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Add plan cache, queries will reuse the plan from cache if source plan is not changed (snapshot is not changed).

This cache is similar to Oracle's Global Plan Cache, but it's stored as LRU cache in memory.

Also, fix the name resolution issue of #16294
fixes #16294

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Aug 26, 2024
@sundy-li sundy-li requested review from xudong963 and Dousir9 August 26, 2024 13:07
@sundy-li sundy-li added the ci-benchmark Benchmark: run all test label Aug 26, 2024
@databendlabs databendlabs deleted a comment from github-actions bot Aug 27, 2024
@databendlabs databendlabs deleted a comment from github-actions bot Aug 27, 2024
@sundy-li sundy-li removed the ci-benchmark Benchmark: run all test label Aug 27, 2024
@sundy-li sundy-li added ci-benchmark Benchmark: run all test ci-benchmark-cloud Benchmark: run only cloud tests for tpch/hits and removed ci-benchmark Benchmark: run all test labels Aug 27, 2024
Copy link
Contributor

Docker Image for PR

  • tag: pr-16333-a4e3e8e-1724725213

note: this image tag is only available for internal use,
please check the internal doc for more details.

Copy link
Contributor

Docker Image for PR

  • tag: pr-16333-a4e3e8e-1724725267

note: this image tag is only available for internal use,
please check the internal doc for more details.

Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

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

Do we need unit tests to verify

  1. get plan from cache
  2. if the table structure changed, can't get plan from cache?

@sundy-li
Copy link
Member Author

Do we need unit tests to verify
get plan from cache
if the table structure changed, can't get plan from cache?

The setting is default enabled, so logictest covered both issues.

@BohuTANG
Copy link
Member

Do we need unit tests to verify
get plan from cache
if the table structure changed, can't get plan from cache?

The setting is default enabled, so logictest covered both issues.

It would be better to add some new logic tests for this PR to ensure it remains unbreakable in the future, as we’re not sure if the existing tests cover this PR or if those tests might change later on.

@BohuTANG BohuTANG merged commit 9d904de into databendlabs:main Aug 28, 2024
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-benchmark-cloud Benchmark: run only cloud tests for tpch/hits pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: COPY INTO <location> does not support tables that need quoting
4 participants