-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: prepared statements over-account for memory on query cache hits #98071
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-support
Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs
P-3
Issues/test failures with no fix SLA
T-sql-queries
SQL Queries Team
Comments
DrewKimball
added
the
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
label
Mar 6, 2023
DrewKimball
added
the
O-support
Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs
label
Mar 6, 2023
exalate-issue-sync
bot
removed
O-support
Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs
T-sql-queries
SQL Queries Team
labels
Mar 6, 2023
cockroach/pkg/sql/conn_executor.go Lines 1703 to 1733 in 0a72a49
PREPARE its memory will get counted multiple times.EDIT: never mind, this is wrong |
michae2
added
the
O-support
Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs
label
Dec 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-support
Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs
P-3
Issues/test failures with no fix SLA
T-sql-queries
SQL Queries Team
Cached prepared statements track their own memory usage, since they are potentially long-lived. This memory accounting includes the metadata needed for the prepared statement (e.g. SQL string, AST etc.) as well as the Memo data structured used by the optimizer to store the query plan. It is possible for the plan for a prepared statement to be kept in the query cache, in which case preparing the statement does not require construction of a new Memo data structure. However, the memory usage of this Memo is still registered with the prepared statement's memory accounting, which can cause a significant overestimate of SQL memory usage - in one customer issue, the reported SQL memory was 3x higher than the actual hardware memory usage.
See also #72581
Jira issue: CRDB-25064
The text was updated successfully, but these errors were encountered: