perf(pg-pool): optimize client retrieval from pool by prioritizing prepared client#3398
perf(pg-pool): optimize client retrieval from pool by prioritizing prepared client#3398cesco69 wants to merge 17 commits intobrianc:masterfrom cesco69:prioritizing-prepared-client
Conversation
…ee client with cached prepared statements see #3397
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.