Spatial Joins in DuckDB
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
DuckDB's spatial joins now run 60x faster, making city-scale geospatial analytics practical on a laptop without a spatial database.
DuckDB, a free database tool, got much faster at answering 'which area does each point fall in?' questions. A test counting 58 million bike trips against 310 neighborhood maps took 30 minutes with the old approach, 107 seconds with a first improvement, and just 30 seconds after a second improvement shipped in version 1.3.0. Anyone doing map-based analysis on ordinary computers benefits.
Teams running geospatial queries in DuckDB can now skip expensive dedicated spatial databases for many workloads. A real query over 58 million NYC bike trips dropped from 30 minutes to 30 seconds on a MacBook M3 Pro purely through version upgrades, 1.2.0's bounding-box pre-filtering plus 1.3.0's automatic R-Tree indexing. No new hardware or migration cost is mentioned; the gains come free with upgrading.
Max Gabrielsson's post benchmarks DuckDB's ST_Intercepts spatial join over 58,033,724 Citi Bike rows against 310 neighborhood polygons. Naive nested-loop joins execute ~18 billion intersections (~30 min). DuckDB 1.2.0 caches minimum bounding rectangles in GEOMETRY and does a piecewise merge join on bounding boxes before exact intersection (107s). DuckDB 1.3.0's SPATIAL_JOIN operator auto-builds an in-memory R-Tree over the larger table's bounding boxes, cutting runtime to 30 seconds.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
DuckDB ST_Intersects NYC Citi Bike Trips NYC Neighborhood Tabulation Areas SPATIAL_JOIN MacBook M3 Pro R-Tree
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Samsung is testing a feature that changes the angle of photos you’ve already taken
Samsung’s new Recompose lets users change photo angles after shooting, potentially reducing the need for multiple shots and improving post-capture editing workflows for photographers and casual users alike.
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.