Skip to content

Is there a pure DuckDB way to order GeoParquet output spatially? #419

Answered by Maxxen
cholmes asked this question in Q&A
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy