Using RTREE in spatial joins #705
Replies: 3 comments
-
|
Check this blog entry https://duckdb.org/2025/08/08/spatial-joins |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ppasquet . thanks. This link you shared is the first link I pointed to in my first comment. All the examples in that link use However, the second link, which is the documentation for R-Tree indexes, says explicitly:
something along the lines of: Hence my question. What approach gets the most performance gain from R-Tree indexing?
|
Beta Was this translation helpful? Give feedback.
-
|
Hello!
This may use the
This won't be optimized if there is a r-tree defined on the table either. The scan/filtering optimization is only performed if there is an r-tree index defined on the table and one of the arguments is a constant (i.e. not a column). If you had an r-tree index defined on the table and issued a query like You can verify which optimizations are applied by inspecting the logical plan using the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey all, I just wanted clarify something about the documentation.
This post from 2025/08 says R-Tree indexing would work fine and improve the performance of spatial join operations. So
However, this page with the documentation about R-Tree indexing says "The R-tree index will only be used to perform "index scans" when the table is filtered (using a WHERE clause)", which susggest I should use:
Could you please clarify whether the best approach here? Would R-Tree indexing improve the performance of spatial join operations?
Beta Was this translation helpful? Give feedback.
All reactions