node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

feat(pg-pool): Optimize client retrieval from pool by prioritizing free client with cached prepared statements

Open cesco69 opened this issue 9 months ago • 0 comments

Hi,

Instead of retrieving the first available client from the pool, would it be possible to first 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.

I have made a PR https://github.com/brianc/node-postgres/pull/3398

cesco69 avatar Mar 04 '25 09:03 cesco69