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

ignore stmtClose to make sure smtPrepare can hit plan cache #31056

Closed
dbsid opened this issue Dec 27, 2021 · 1 comment
Closed

ignore stmtClose to make sure smtPrepare can hit plan cache #31056

dbsid opened this issue Dec 27, 2021 · 1 comment
Assignees
Labels
epic/plan-cache sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@dbsid
Copy link
Contributor

dbsid commented Dec 27, 2021

Enhancement

It's not uncommon that real-world application will follow the stmtPrepare -> stmtExec -> stmtClose loop.
In TiDB, the stmtClose will evict the cached plan, and the following stmtPrepare need to recompile the plan, make the plan cache useless.
In Oracle, stmtClose only close the session local handle. The cached plan still exists the in the global cache shared pool, the following prepare call can still re-use the cached plan.

I propose adding a global variable, to ignore the stmtClose calls, so that the cached plan can be re-used.

@dbsid dbsid added the type/enhancement The issue or PR belongs to an enhancement. label Dec 27, 2021
@qw4990 qw4990 self-assigned this Feb 28, 2022
@qw4990
Copy link
Contributor

qw4990 commented May 9, 2022

This task has been finished by #32928.

@qw4990 qw4990 closed this as completed May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/plan-cache sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

3 participants