duckdb / duckdb/duckdb-spatial
NOT ST_Intersects(a, b) leads to OutOfMemoryException while ST_Intersects(a, b) runs in seconds
- Dominant language
- C
- Stars
- 708
- Forks
- 96
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 5
Description
ST_Intersects(a, b) is really fast but I get OutOfMemoryException for NOT ST_Intersects(a, b). Apparently the sjoin optimizations only work for positive queries atm.
In my case I had a huge GHSL DEGURBA multipolygon file with 0.5M of polys and millions of points to intersect. My solution was using NOT EXISTS and SELECT 1, selecting only the first poly that intersected a point instead of checking every single one. This ran in seconds again.
Issue ermerged from [this discussion](https://www.linkedin.com/posts/dominik-weckm%C3%BCller_til-be-wary-of-using-not-stintersectsa-activity-7428759124668149760--mX7).
Happy to provide sample data / queries if needed.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.