Hi, I'm performing a spatial join with:
CREATE TABLE regions_obs AS
SELECT adm2_name, count(*) AS cnt
FROM atlas a
JOIN regions_qc r ON ST_Within(a.geom, r.geometry)
GROUP BY adm2_name;
The atlas table has 55 million rows and an RTREE index on the geometry. The regions_qc file has 17 polygons. The query above takes several hours and a lot of memory on a machine with 15 cores and 180GB of RAM.
However, this query
CREATE TABLE regions_obs AS
SELECT adm2_name, count(*) AS cnt
FROM atlas a
JOIN regions_qc r ON ST_DWithin(a.geom, r.geometry,0)
GROUP BY adm2_name;
Which, to my understanding, should be identical, finishes in about 15 minutes.
Any idea why that is ?
With Duckdb 1.5.3 and most recent spatial extension commit.
Hi, I'm performing a spatial join with:
The atlas table has 55 million rows and an RTREE index on the geometry. The regions_qc file has 17 polygons. The query above takes several hours and a lot of memory on a machine with 15 cores and 180GB of RAM.
However, this query
Which, to my understanding, should be identical, finishes in about 15 minutes.
Any idea why that is ?
With Duckdb 1.5.3 and most recent spatial extension commit.