On Fri, Jan 22, 2016 at 1:29 PM, Richard Hipp <drh at sqlite.org> wrote:

> The (partial) index is also useless for sorting:
>
>      SELECT * FROM t1 ORDER BY x;
>

Is that a fundamental thing though? Or a pragmatic implementation decision?

Nulls come before or after non-null, no? So couldn't the sort work like (or
the reverse):
- scan the index, lookup the row in the table, to get the column values.
- scan the table, probing the index to know whether the row was already
processed if found (or will be if reversed).

Doesn't the above have the potential to be faster than sorting? Or at least
is it "correct"?
I genuinely don't know and I'm curious about it, that's all. Thanks, --DD

Reply via email to