Diagnostic step 1
Option A (recommended): keep PgBouncer in transaction pooling, change client to avoid server-side prepared statements (for pgx set pgx.ConnConfig.PreferSimpleProtocol = true or disable Prepare/Statement caching in your driver).
Generated Oct 24, 2026, 9:21:01 AM
Option A (recommended): keep PgBouncer in transaction pooling, change client to avoid server-side prepared statements (for pgx set pgx.ConnConfig.PreferSimpleProtocol = true or disable Prepare/Statement caching in your driver).
Option B: keep server-side prepares and switch PgBouncer to session pooling for the subset of services that need them (use a separate PgBouncer pool for these apps).
Test: deploy the driver change to a staging service, run the same queries and compare EXPLAIN ANALYZE from the app path — partition pruning and index scans should reappear.
If driver change is infeasible, isolate problematic services onto a session-pooling PgBouncer instance and keep others on transaction pooling.
Instrument: capture pg_stat_statements and PgBouncer logs during tests to confirm plan shape and latency improvements.