You can’t UPDATE what you can’t find: ClickHouse vs PostgreSQL
ClickHouse 25.7's SQL-standard UPDATEs were benchmarked against PostgreSQL 17.5 on identical hardware using the 600M-row TPC-H lineitem table, with cold and hot runs. ClickHouse wins bulk updates by up to 4,000× because most bulk WHERE clauses can't use the primary key index. That forces full scans, where PostgreSQL takes 380–390 s and ClickHouse's columnar, parallel scan takes 0.09–5.23 s. Point updates are roughly at parity and cached point updates stay competitive. The comparison isn't apples-to-apples: PostgreSQL wraps every statement in a transaction and fsyncs WAL at commit by default, while ClickHouse skips per-statement transactions and defaults to fsync_after_insert=false.
Related posts
- ClickHouse and PostgreSQL - a Match Made in Data Heaven - part 1
ClickHouse mediumAdept
ClickHouse can query PostgreSQL data in place through the postgresql table function and the PostgreSQL table engine. Simple WHERE clauses are pushed down to Postgres, while aggregation, joins, sorting and LIMIT run in ClickHouse. On the 28M-row UK house price dataset, a low-selectivity filter makes Postgres choose a parallel sequential scan over the index, taking about 28s, and querying through ClickHouse gives similar times because Postgres still does the scan. Queries using ClickHouse-specific functions such as toYear are not pushed down and can run much slower. Rewriting joins with conditional aggregates like medianIf, or copying the data into local MergeTree tables, is what delivers the large speedups.
- How we made ClickHouse UPDATEs 1,000× faster (Part 3: Benchmarks)
ClickHouse hardMaster
ClickHouse's new standard SQL UPDATEs, implemented as lightweight patch parts, make changes visible up to ~1,000–1,700× faster than classic mutations on a 600M-row TPC-H lineitem table: one bulk update dropped from about 100 s to 60 ms. The benchmark compares classic mutations, on-the-fly mutations, lightweight updates and ReplacingMergeTree inserts for both bulk and single-row updates, measuring time to visibility and worst-case query slowdown before merges. Lightweight updates add only about 12–15% average query overhead, rising to 39–121% in a rare join-mode fallback. On-the-fly mutations average 149% slowdown, and ReplacingMergeTree with FINAL averages about 280% slowdown with 20–200× the memory. ReplacingMergeTree inserts are the fastest way to write single rows, but lightweight updates give the best balance of write speed and query cost.
- ClickHouse and PostgreSQL - a Match Made in Data Heaven - part 2
ClickHouse mediumAdept
ClickHouse dictionaries backed by a PostgreSQL source can replace joins against Postgres-resident mapping tables, keeping the data in memory and refreshing it via LIFETIME and an invalidate_query. On the UK house price dataset, a regional price-change query took 48.5s in Postgres, 4.1s in ClickHouse when joining through the PostgreSQL table engine, and 0.44s using dictGet against a complex_key_hashed dictionary. The PostgreSQL table engine also supports "reverse ETL": an INSERT ... SELECT can push aggregated monthly price statistics computed in ClickHouse back into a Postgres summary table for a user-facing application to query.
- Longbridge Technology simplifies their architecture and achieves 10x performance boost with ClickHouse
ClickHouse mediumAdept
Longbridge, a Singapore online brokerage, replaced a fragmented market-data stack of PostgreSQL (historical), Redis (real-time) and DynamoDB (high-write) with ClickHouse after evaluating it against TimescaleDB and TDengine for write throughput, Decimal support, time functions and aggregations. Historical data was migrated via ClickHouse external tables over OSS and Alibaba Cloud DTS, which merged 128 PostgreSQL sub-tables into one table and converted varchar fields to Decimal; Redis was kept for real-time data with ticker-level writes moved to ClickHouse. Reported results include about 5x compression (500GB down to 100GB), 10x faster single-table writes than PostgreSQL, and built-in aggregation and window functions replacing scheduled statistics jobs.
- Postgres at Open House NYC
ClickHouse easyNovice
ClickHouse used its Open House NYC keynote to launch WalShadow, an open-source engine that replicates Postgres into ClickHouse from the physical WAL instead of logical replication. It decodes WAL outside the source and uses a schema-only shadow Postgres to track DDL, effectively making ClickHouse an analytical physical standby. On 8-vCPU instances it showed about 200 ms commit-to-visible latency and 300K rows/s, versus about 10 s and 120K rows/s for PeerDB. The keynote also opened a Google Cloud private preview of ClickHouse Managed Postgres and released a chdb Postgres extension that extends COPY to import from S3, GCS and Azure and outperformed DuckDB-based extensions on the NYC Taxi import benchmark.