-
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.41% 67.44% +0.02%
==========================================
Files 1592 1592
Lines 258024 258148 +124
==========================================
+ Hits 173948 174102 +154
+ Misses 84076 84046 -30 ☔ View full report in Codecov by Sentry. |
ffdc432
to
aa4830b
Compare
7381f58
to
13b3f42
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
…d in normalizer Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
637bbf0
to
6f637c8
Compare
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…sion Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
d7ff21b
to
5bdb210
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
5bdb210
to
e5681c2
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…ding the plan Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
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. |
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.
Related Issue(s)
Checklist