<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/columnar-databases-are-40x-faster-than-postgres-hbq5mffwk" -->

---
title: Columnar Databases Are 40X Faster Than Postgres | daily.dev
description: Columnar databases like ClickHouse and DuckDB can run aggregation queries over 40 times faster than Postgres, demonstrated with a 100 million row group-by...
canonical: https://daily.dev/posts/columnar-databases-are-40x-faster-than-postgres-hbq5mffwk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Columnar Databases Are 40X Faster Than Postgres | daily.dev
og:description: Columnar databases like ClickHouse and DuckDB can run aggregation queries over 40 times faster than Postgres, demonstrated with a 100 million row group-by...
og:url: https://daily.dev/posts/columnar-databases-are-40x-faster-than-postgres-hbq5mffwk
og:image: https://api.daily.dev/og/posts/HbQ5mffwk.png
og:image:alt: Columnar Databases Are 40X Faster Than Postgres
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Columnar Databases Are 40X Faster Than Postgres

**[YouTube](https://daily.dev/sources/youtube)** · 1 min read · 2 upvotes · 0 comments

## Summary

Columnar databases like ClickHouse and DuckDB can run aggregation queries over 40 times faster than Postgres, demonstrated with a 100 million row group-by query (9.7s in Postgres vs 0.28s in ClickHouse vs 0.24s in DuckDB). However, for single-row lookups by ID, Postgres and DuckDB stay at 2ms while ClickHouse jumps to 168ms because its sort key is timestamp-first, forcing it to scan all 12,208 blocks and reassemble the row from eight column files, illustrating the classic row-store vs column-store trade-off.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=VGdMembUCC0>

## Questions this post answers

### Why is ClickHouse slower than Postgres when looking up a single row by ID?

ClickHouse only indexes via its sort key, and when a table is sorted by timestamp first and ID second, a single-ID lookup has no way to know which block holds the row. It ends up scanning all blocks (12,208 in one benchmark), then opening all column files to reassemble the row, resulting in 168 milliseconds versus Postgres's 2 milliseconds using a B-tree index.

_See daily.dev for more real-world benchmarks when weighing columnar versus row-store databases for a workload._

### How much faster is ClickHouse than Postgres for aggregation queries over large datasets?

ClickHouse can be over 40 times faster than Postgres for aggregation queries. In a benchmark over 100 million rows, a group-by query aggregating revenue took roughly 9.7 seconds in Postgres, 0.28 seconds in ClickHouse, and 0.24 seconds in DuckDB.

_Developers comparing analytics databases can find similar benchmark breakdowns on daily.dev._

## Similar posts on daily.dev

- [ClickHouse vs PostgreSQL: Choosing the Right Database for Analytics](https://daily.dev/posts/clickhouse-vs-postgresql-choosing-the-right-database-for-analytics-ckxz2ek9o) · BigData Boutique blog · 3 upvotes · 0 comments
- [Postgres vs ClickHouse is the wrong question. I use both.](https://daily.dev/posts/postgres-vs-clickhouse-is-the-wrong-question-i-use-both--kj77irn0i) · Medium · 0 upvotes · 0 comments
- [92x faster queries: How Open Electricity uses ClickHouse to track Australia’s energy transition in real time](https://daily.dev/posts/92x-faster-queries-how-open-electricity-uses-clickhouse-to-track-australia-s-energy-transition-in-r-ce1bdfqje) · ClickHouse · 5 upvotes · 0 comments
- [Switching from PostgreSQL to ClickHouse for Improved Performance and Scalability](https://daily.dev/posts/switching-from-postgresql-to-clickhouse-for-improved-performance-and-scalability-kjtwee69g) · InfoQ · 5 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql), [#clickhouse](https://daily.dev/tags/clickhouse), [#duckdb](https://daily.dev/tags/duckdb)

[View this post on daily.dev](https://daily.dev/posts/columnar-databases-are-40x-faster-than-postgres-hbq5mffwk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Columnar Databases Are 40X Faster Than Postgres","url":"https://daily.dev/posts/columnar-databases-are-40x-faster-than-postgres-hbq5mffwk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/columnar-databases-are-40x-faster-than-postgres-hbq5mffwk"},"datePublished":"2026-09-30T05:40:07.783Z","dateModified":"2026-09-30T05:40:25.171Z","description":"Columnar databases like ClickHouse and DuckDB can run aggregation queries over 40 times faster than Postgres, demonstrated with a 100 million row group-by...","image":"https://i.ytimg.com/vi/VGdMembUCC0/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/VGdMembUCC0/sddefault.jpg","isAccessibleForFree":true,"articleSection":"YouTube","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"YouTube","logo":"https://media.daily.dev/image/upload/s--W5zMumpP--/f_auto/v1725350181/logos/youtube","url":"https://daily.dev/sources/youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/columnar-databases-are-40x-faster-than-postgres-hbq5mffwk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,postgresql,clickhouse,duckdb","timeRequired":"PT1M","video":{"@type":"VideoObject","name":"Columnar Databases Are 40X Faster Than Postgres","description":"Columnar databases like ClickHouse and DuckDB can run aggregation queries over 40 times faster than Postgres, demonstrated with a 100 million row group-by...","thumbnailUrl":"https://i.ytimg.com/vi/VGdMembUCC0/sddefault.jpg","uploadDate":"2026-09-30T05:40:07.783Z","duration":"PT1M","url":"https://api.daily.dev/r/HbQ5mffwk","embedUrl":"https://www.youtube.com/embed/VGdMembUCC0"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"YouTube","item":"https://daily.dev/sources/youtube"},{"@type":"ListItem","position":3,"name":"Columnar Databases Are 40X Faster Than Postgres"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/columnar-databases-are-40x-faster-than-postgres-hbq5mffwk#faq","mainEntity":[{"@type":"Question","name":"Why is ClickHouse slower than Postgres when looking up a single row by ID?","acceptedAnswer":{"@type":"Answer","text":"ClickHouse only indexes via its sort key, and when a table is sorted by timestamp first and ID second, a single-ID lookup has no way to know which block holds the row. It ends up scanning all blocks (12,208 in one benchmark), then opening all column files to reassemble the row, resulting in 168 milliseconds versus Postgres's 2 milliseconds using a B-tree index. See daily.dev for more real-world benchmarks when weighing columnar versus row-store databases for a workload."}},{"@type":"Question","name":"How much faster is ClickHouse than Postgres for aggregation queries over large datasets?","acceptedAnswer":{"@type":"Answer","text":"ClickHouse can be over 40 times faster than Postgres for aggregation queries. In a benchmark over 100 million rows, a group-by query aggregating revenue took roughly 9.7 seconds in Postgres, 0.28 seconds in ClickHouse, and 0.24 seconds in DuckDB. Developers comparing analytics databases can find similar benchmark breakdowns on daily.dev."}}]}
```

