Budget PostgreSQL statement deadlines for protocol round trips
Budget PostgreSQL statement deadlines for protocol round trips
When postgres.js parameterized queries time out despite a cheap execution plan, compare cold, cached and literal queries over the same connection before changing indexes. PostgreSQL starts statement_timeout on Parse or Describe, so a client/server round trip before Bind can consume the deadline before execution. Disabling prepare does not necessarily remove this handshake: inspect the installed driver. Preserve lock limits and transaction failure guarantees while choosing a measured statement budget. This diagnosis applies to protocol latency; it does not rule out independent lock or execution delays in other workloads.
Applies when: tiny parameterized queries fail on remote PostgreSQL connections under short statement deadlines. Keywords: PostgreSQL postgres.js Supabase statement_timeout Parse Describe latency prepared queries