Christophe Pettus: All Your GUCs in a Row: client_connection_check_interval
The article discusses the PostgreSQL parameter 'client_connection_check_interval', which was introduced in version 14. This parameter helps detect when a client connection is lost during long-running queries, preventing unnecessary resource usage. It is recommended to enable this parameter for better management of analytics workloads.
- ▪The 'client_connection_check_interval' parameter polls the client socket during query execution to check for closed connections.
- ▪The default setting for this parameter is 0, meaning it is disabled, which can lead to wasted resources on long-running queries.
- ▪Enabling this parameter can significantly improve performance for workloads with long queries, especially in managed PostgreSQL environments.
Opening excerpt (first ~120 words) tap to expand
2026-05-24 4 min PostgreSQL All Your GUCs in a Row: client_connection_check_interval A genuinely useful parameter that almost nobody knows about. Added in PostgreSQL 14, off by default, fixes a specific pathology that anyone who has run analytics workloads has lived through at least once. The pathology A user runs an expensive query — a multi-hour analytics scan, a runaway report — and walks away. Or their laptop dies. Or their VPN drops. The TCP connection is gone, but PostgreSQL doesn’t know. The backend continues executing the query at full cost for the full duration, eventually completes, attempts to send the result to a socket that closed two hours ago, and only at that point notices the client is gone.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Postgr.