Hi All, Attached is a first attempt to implement GIST index (only) scans for ORDER BY column clauses. The idea is that it order by column for some datatypes is a special case of ordering by distance: ORDER BY a == ORDER BY a <-> MIN_VALUE and ORDER BY a DESC == ORDER BY a <-> MAX_VALUE This allows implementing GIST ordered scans for btree_gist datatypes. This in turn makes using GIST with partitioning feasible (I have described issues with such usage in my previous e-mails - see below). The solution is not ideal as it requires registering “<“ and “>” operators as ordering operators in opfamily (which in turn makes it possible to issue somewhat meaningless “ORDER BY a < ‘constant’) The problem is though that right now handling of ORDER BY column clauses is tightly coupled to BTree. It would be good to refactor the code so that semantics of ORDER BY column could be more flexible. It would be great if someone could take a look at it. Thanks, Michal |
DRAFT-gist-orderby.patch
Description: Binary data
|