-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Faster Prepared Statement Execution by Using Raw SQL for Caching #17777
base: main
Are you sure you want to change the base?
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
1767cb0
to
149f8f8
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17777 +/- ##
==========================================
- Coverage 67.45% 67.44% -0.01%
==========================================
Files 1594 1594
Lines 259064 259042 -22
==========================================
- Hits 174760 174721 -39
- Misses 84304 84321 +17 ☔ View full report in Codecov by Sentry. |
ffdc432
to
aa4830b
Compare
7381f58
to
13b3f42
Compare
637bbf0
to
6f637c8
Compare
5bdb210
to
e5681c2
Compare
Hello! 👋 This Pull Request is now handled by arewefastyet. The current HEAD and future commits will be benchmarked. You can find the performance comparison on the arewefastyet website. |
476e038
to
f5c7827
Compare
…d in normalizer Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
…sion Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
…ding the plan Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
…hed and uncached plan, moved prepare path to it Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
…tting plan without parsing and normalizing Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
…Node Signed-off-by: Harshit Gangal <[email protected]>
b572287
to
7949d15
Compare
Description
This PR changes the way Vitess handles prepared statements by modifying the plan cache lookup mechanism. Instead of normalizing and parsing the SQL string before looking up a cached execution plan, we now use the raw SQL string as provided in the PREPARE statement. This eliminates unnecessary parsing, improves lookup efficiency, and reduces overhead in query execution.
Problem Statement
Currently, when a client issues a PREPARE statement, vtgate:
What to do About it
Instead of parsing and normalizing the query before checking the plan cache, we will:
• Directly store the original SQL string from the PREPARE statement in the cache.
• Use this unmodified SQL string for cache lookups.
• Only parse the query when the plan is not found in the cache.
Benchmark
Related Issue(s)
Checklist