Home / Companies / ClickHouse / Blog / Post Details
Content Deep Dive

Can your Postgres survive a bad query?

Blog post from ClickHouse

Post Details
Company
Date Published
Author
-
Word Count
2,949
Company Posts That Month
39
Language
English
Hacker News Points
-
Post removed?
No
Summary

Postgres memory management can be difficult to predict because work_mem applies to individual plan nodes and parallel workers rather than imposing a query-wide limit, while some executor structures, such as recursive CTE deduplication hash tables, cannot spill to disk and may grow until completion or memory exhaustion. Using a recursive graph query designed to consume roughly 1 GiB per connection, the comparison tested ClickHouse Managed Postgres, Google Cloud SQL, PlanetScale Postgres, and Amazon RDS under increasing concurrent load. The reported results found that ClickHouse Managed Postgres enforced a lower committed-memory ceiling and returned recoverable out-of-memory query errors while keeping clusters available, whereas RDS allowed memory use to rise further but could trigger Linux OOM events, database restarts, and crash recovery under severe pressure. Cloud SQL and PlanetScale used supervisory mechanisms to terminate sessions before kernel-level exhaustion, preserving service in some cases but experiencing session failures and, at higher loads, instability or crashes. The source concludes that reserving memory for database and operating-system caches while limiting runaway query memory sacrifices some throughput at moderate load but can favor cluster uptime over allowing individual workloads to consume most available RAM.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
LLM 1 6,025 1,161 240 +15%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.