Skip to content
Discussion options

You must be logged in to vote

Hello! Unfortunately, DuckDB does not support overriding the comparison operators (used to sort) for custom types, meaning ORDER BY <geometry> will just order based on the lexical order of the bytes in the internal binary representation. The r-tree index is completely separate from ordering. I know that other databases (like Postgres) sometimes can perform an index scan instead of explicitly sorting when executing an order-by, but this requires the ordering criteria to map to the physical order of the index. In the case of R-Trees, I can't think of any way that would work.

Perhaps there could be a "dummy" scalar function the optimizer could detect to do this if the column is r-tree indexe…

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@Maxxen
Comment options

@Maxxen
Comment options

@cholmes
Comment options

@Maxxen
Comment options

@cholmes
Comment options

Answer selected by cholmes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants