Skip to content

planner: Allow prepared and non-prepared queries with set_var and resource_group hints to be cached. #62367

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wddevries
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #60920

Problem Summary:
Prepared and non-prepared queries with set_var and resource_group hints cannot be cached.

What changed and how does it work?

This pull request makes two changes:

  • it adds code to handle set_vars hints for cached queries to planner.Optimize(), and
  • it removes the code that excludes queries with set_var and resouce_group hints from the plan caches.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 11, 2025
Copy link

tiprow bot commented Jul 11, 2025

Hi @wddevries. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

codecov bot commented Jul 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.3608%. Comparing base (6b7a0ed) to head (78ff2cc).
Report is 18 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #62367        +/-   ##
================================================
+ Coverage   72.9064%   73.3608%   +0.4544%     
================================================
  Files          1751       1753         +2     
  Lines        484569     489374      +4805     
================================================
+ Hits         353282     359009      +5727     
+ Misses       109672     108631      -1041     
- Partials      21615      21734       +119     
Flag Coverage Δ
integration 42.3571% <100.0000%> (?)
unit 72.1931% <50.0000%> (+0.0285%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 46.3400% <ø> (-0.0026%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wddevries
Copy link
Contributor Author

/test check-dev2

Copy link

tiprow bot commented Jul 11, 2025

@wddevries: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-dev2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Contributor

@terry1purcell terry1purcell left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

ti-chi-bot bot commented Jul 12, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: terry1purcell
Once this PR has been reviewed and has the lgtm label, please assign qw4990 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 12, 2025
Copy link

ti-chi-bot bot commented Jul 12, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-07-12 14:27:35.961361916 +0000 UTC m=+2355508.684540897: ☑️ agreed by terry1purcell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The non-prepared cache should support queries with hints.
2 participants