A rule for implementing a
LogicalSortExpression
as a scan of an appropriately-ordered index.
There are a few things to note about how this rule currently works:
-
It relies on
KeyExpression.isPrefixKey(KeyExpression)
to do the "heavy lifting" of determining
whether or not a sort can be implemented using an index, which currently involves calling
ExpressionRef.get()
. This obviously does not work if the ExpressionRef
is not gettable
(for example, if it were a group).
-
It will plan the sort using the first index with an appropriate ordering.
Ths first of these details will definitely change as the planner improves.