DuckDB vs Polars: one query, two engines, three benchmarks with three different winners
In the Polars team's own benchmark, one setting took Polars from 152 seconds to 24 at scale factor 100, and DuckDB still finished first at 19.7. What actually differs between an in-process SQL database and a DataFrame library: lazy plans, memory, Polars 2's streaming default, Arrow interop, and what each benchmark (and who runs it) really shows.
On this page
- What each one is
- One query through both engines
- Bigger than your RAM
- Three referees, three winners
- Referee 1: the Polars team (PDS-H, May 2025)
- Referee 2: DuckDB’s team (db-benchmark, updated 25 Nov 2026)
- Referee 3: ClickBench (run by ClickHouse, Nov 2026)
- You don’t have to choose
- Which one first?
152 seconds, or 24. Same Polars, same 22 queries, roughly 100 GB of data: the only difference is which engine Polars used. That’s from the Polars team’s own published benchmark, and in the same run DuckDB finished first at 19.7 seconds.
That one result says a lot about the “DuckDB vs Polars” question. The two tools are closer than most comparisons suggest, and the setting you run them with can matter more than which one you pick. Below: what each one is, how one query moves through both, what happens when the data outgrows RAM, and three published benchmarks from three different referees, each with a different winner. Every number comes from the projects’ docs and release notes, or from published benchmark results (read on 27 November 2026). Each result says who ran it. Nothing was benchmarked for this post.
What each one is
| DuckDB | Polars | |
|---|---|---|
| What it is | In-process SQL database (“completely embedded within a host process”) | DataFrame library, “core is written in Rust” |
| You write | SQL | Chained expressions (plus a SQL subset) |
| Storage | Its own single-file database format with ACID transactions, or Parquet/CSV/lakehouse formats | No database file: reads and writes CSV, Parquet, JSON, IPC, databases, cloud storage |
| Execution | Columnar, vectorized, multi-threaded | Columnar; lazy plans run on the streaming engine by default since 2.0 |
| Bigger than RAM | Spills to disk; memory_limit defaults to 80% of RAM |
Out-of-core on by default since 2.0 (80% of RAM); out-of-core joins in 2.2 |
| Current version | 2.0.1 (2.0 LTS “Cinnamon Teal”: 2.0.0 on 21 Oct 2026, 2.0.1 on 20 Nov 2026) | 2.2.0 (24 Nov 2026) |
| License | MIT | MIT |
Sources: Why DuckDB, DuckDB 2.0 announcement, Polars user guide, Polars releases.
Under the hood they’re cousins: both store data by column, both process it in batches of values, and both can read and write Apache Arrow data. The real difference is the interface, and what each project optimizes for.
One query through both engines
Take ClickBench’s query 13: the ten most common non-empty search phrases in a single 14.8 GB Parquet file (100 million rows, 105 columns).
In DuckDB it’s SQL, run straight on the file:
SELECT SearchPhrase, COUNT(*) AS c FROM 'hits.parquet'
WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10;
In Polars it’s a chain of expressions on a LazyFrame:
(pl.scan_parquet("hits.parquet")
.filter(pl.col("SearchPhrase") != "")
.group_by("SearchPhrase")
.agg(pl.len().alias("c"))
.sort("c", descending=True)
.head(10)
.collect())
Nothing runs until collect(). That’s the lazy API: Polars sees the whole plan before running anything, so its optimizer can do what DuckDB’s does for SQL. Both push the projection into the scan, so only one of the 105 columns is read. Both push the filter into the reader too, so empty phrases are dropped during the read (Polars lazy API, Polars optimizations, DuckDB Parquet). Even Polars’ SQL interface goes through the same path: “Polars translates SQL queries into expressions, which are then executed using its own engine” (Polars SQL).
On ClickBench’s 16-vCPU machine, warm, this query took 0.56 s in DuckDB 2.0 and 0.71 s in Polars 2.1.
The trap is the eager API. pl.read_parquet(...) loads the file into a DataFrame first, and only then do you filter. Polars’ own docs say “the lazy API should be preferred unless you are either interested in the intermediate results” or exploring. If you’re comparing DuckDB with an eager Polars script, you’re not comparing the engines.
Bigger than your RAM
DuckDB calls this “a key strength”: larger-than-memory workloads “are supported by spilling to disk”. Grouping, joins, sorting and window functions can all spill. By default DuckDB uses up to 80% of RAM (memory_limit) and writes the overflow to a .tmp directory. Its docs are honest about the limit: “If multiple blocking operators appear in the same query, DuckDB may still throw an out-of-memory exception” (tuning guide, configuration).
Polars got there later. The Polars 2.0 RC announced that “Calling collect on a LazyFrame will now default to the streaming engine” (announcement). The 2.0.0 release (6 October 2026) shipped “Enable OOC by default with 80% of available RAM as threshold” and a streaming out-of-core sort. On 24 November 2026, 2.2.0 added out-of-core joins (releases).
One catch when you upgrade: the streaming engine doesn’t guarantee row order by default for operations such as joins, group-bys and unpivot. If your code relies on order, sort explicitly or pass maintain_order=True.
Three referees, three winners
Referee 1: the Polars team (PDS-H, May 2025)
PDS-H is the Polars team’s benchmark: the 22 TPC-H queries adapted for DataFrame libraries, “not comparable to published TPC-H Benchmark results”. It ran on an AWS c7a.24xlarge (96 vCPU, 192 GB) with Polars 1.30 and DuckDB 1.3.0 (results, code).
At scale factor 10, Polars streaming wins. At 100, DuckDB wins. Polars’ in-memory engine is 6.4 times slower than its streaming engine at SF-100 (152.27 / 23.94). The Polars team’s own summary: “Polars and DuckDB prove to be in a league of their own.” In that run, pandas 2.2.3 needed 365.71 s at SF-10, 94 times the fastest.
Referee 2: DuckDB’s team (db-benchmark, updated 25 Nov 2026)
H2O.ai’s old group-by and join benchmark has been maintained by DuckDB Labs since 2023 (db-benchmark). The latest results compare DuckDB 2.0.1 with Polars 2.1.0. The Polars script uses collect(engine="streaming") on a memory-mapped Arrow IPC file. On the 16-core, 32 GB machine at 5 GB (100 million rows), summing first runs from the published time.csv: group-by DuckDB 7.96 s vs Polars 14.83 s, join 9.68 s vs 54.24 s.
At 50 GB on that same 32 GB machine, DuckDB has a result (348 s, spilling to disk). Polars has no entry; that run is older than Polars 2.2’s out-of-core joins. On the 128-core machine, the 50 GB group-by is 30.5 s vs 111.6 s.
Referee 3: ClickBench (run by ClickHouse, Nov 2026)
ClickBench is maintained by ClickHouse, so it isn’t run by either side’s own team. Its “DuckDB (Parquet, single)” and “Polars (Parquet)” entries query the same 14.8 GB Parquet file in place, with 43 queries each.
On the 16-vCPU c6a.4xlarge, warm, Polars wins 28 of the 43 queries, yet DuckDB finishes the set first: 33.86 s vs 36.86 s. Polars takes the tiny queries: of the 24 that DuckDB answers in under half a second, Polars is faster on 21. DuckDB takes most of the heavy group-bys, such as GROUP BY URL (2.43 s vs 4.89 s). Read the harness before you read the chart: DuckDB’s entry launches a fresh duckdb process for every run, while Polars’ entry keeps one Python server alive. On cold runs DuckDB wins 40 of 43. On a 2 vCPU / 4 GiB machine, the totals are 249 s for DuckDB and 400 s for Polars.
So “who’s faster” depends on who ran the test, how big the data is, and whether you count wins or seconds.
You don’t have to choose
DuckDB can query a Polars DataFrame by its variable name, and .pl() returns the result as a Polars frame (DuckDB + Polars guide):
import duckdb, polars as pl
df = pl.read_csv("sales.csv")
top = duckdb.sql("SELECT region, SUM(amount) FROM df GROUP BY 1").pl()
The handoff goes through Apache Arrow. DuckDB’s team describes “zero-copy streaming of data between DuckDB and Arrow” (DuckDB blog, 2021), and Polars says it consumes and produces Arrow data “often with zero-copy operations”. Use SQL where SQL is easier, and expressions where they are.
Two pieces of trivia: DuckDB names its releases after ducks (2.0 is “Cinnamon Teal”, 1.2 was “Histrionicus”, the Harlequin duck). And in August 2026, DuckLabs, the company behind DuckDB, agreed to join AWS, while DuckDB itself stays MIT-licensed under the non-profit DuckDB Foundation (announcement).
Which one first?
- Start with DuckDB if your team speaks SQL, you want one database file with transactions, or you need its extensions. Its spill-to-disk is the more mature of the two.
- Start with Polars if you live in Python and like composable expressions, or want its GPU engine (
engine="gpu", NVIDIA, open beta). Use the lazy API, and check your version: on Polars 1.x, ask forcollect(engine="streaming"). - Leaving pandas? Either one is a big step up.
Quick checks for your own setup: print(pl.__version__) (2.x streams by default), and in DuckDB SELECT current_setting('memory_limit');.
Which camp are you in: team DuckDB, team Polars, or both?