-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
perf(pg-pool): optimize client retrieval from pool by prioritizing prepared client #3398
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
Conversation
…ee client with cached prepared statements see brianc#3397
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tests.
This comment was marked as resolved.
This comment was marked as resolved.
You can call |
Thanks! done with 20e7fa2 |
Merge this PR only if this PR brianc/node-postgres#3398 is merged and released
While I appreciate the thought here....I'm thinking this might be a bit over-optimization and prioritizing a somewhat lesser used use-case over the general purpose. For example, applications that don't use named queries will incur an additional for-loop over the connection pool every time issuing a query via |
Hi, thanks for the review!
No, query without "name" don't are affected by my PR
Absolutly true! I don't found a way for retrive the query "name" from the pool class. If there are a way for retrive the query "name" into |
see #3397
Instead of retrieving the first available client from the pool, check if there is a free client that already has cached prepared statements. This could improve performance by reducing the need to re-prepare statements on different clients.