-
Notifications
You must be signed in to change notification settings - Fork 250
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
postgres statement cache behavior with traceparent comments? #5017
Comments
maybe cache misses are inevitable here because these are meant to be distinct queries sent the to the server. but i wonder if there's a way to put the comment on just the EXECUTE part and not the PREPARE |
Good question. I'm gonna pull this issue into the ongoing Tracing GA project and think about it. |
By the way let me know if you run into any other issues related to tracing, this is super relevant right now, and we will tackle them asap. A good chunk of important bugfixes might hopefully make it into the next release, and more are coming soon. |
Fixed in #5082 |
the postgres driver uses prepared statements to prevent sql injection. a new statement is created per query, and then cached for subsequent queries. this works as expected.
however, when you enable tracing it adds sql comments to your statements:
prisma-engines/query-engine/connectors/sql-query-connector/src/sql_trace.rs
Lines 34 to 37 in edd552c
wouldn't this mean the statement cache, which uses the raw sql text as the cache key, would no longer be effective?
prisma-engines/quaint/src/connector/postgres/native/mod.rs
Lines 322 to 323 in edd552c
prisma-engines/quaint/src/connector/postgres/native/mod.rs
Lines 85 to 86 in edd552c
cc @aqrln
The text was updated successfully, but these errors were encountered: