Experiments with the optimization of ORDER BY and GROUP BY clauses.
Adjust the query planner to keep track of the number of ORDER BY terms
satisfied.  Still doesn't do anything with this information.  Some tests
fail after this check-in, but all failures are believed to be benign.  The
failures will be addressed at a later stage.
Make the partial-ORDER-BY information in the query planner available to the
SELECT code generator.  Still doesn't make a difference in the generated code.
First attempt at getting block-sort to work.  This is an incremental check-in.
There are many problems still to be worked out.
Make sure the where.c query planner never reports that the number of ORDER BY
terms that are satisfied by indices is negative.
Avoid reusing temporary registers in co-routines when doing
block-sorting.
Fix a problem in the block-sort logic that can arise if the VDBE opcode
array is resized while the block-sort logic is being coded.  "make test"
now runs to completion, though there are still 17 failures.
Make it possible for block-sort to use the OP_SorterOpen sorter in addition
to a generic OP_OpenEphemeral.
Fix query planner weights associated with choosing block-sorting.  Fix
block sorting of tables with collating functions.  Fix various test cases.
All "veryquick" tests are now passing, though more tests need to be added.
Merge the vdbesort.c optimization from trunk.
Merge trunk fixes for "x IN (?)" handling.
New test case for block-sorting.
Fix the OFFSET clause so that it works correctly on queries that lack
a FROM clause.  Ticket [07d6a0453d4ed8].
Merge the OFFSET-on-query-without-FROM fix from trunk.
Avoid leaking memory in an obscure case where the flattener adds an ORDER BY clause to the recursive part of a recursive query.
Change the names of SRT_DistTable and SRT_Table used by CTE to more
meaningful SRT_DistFifo and SRT_Fifo, respectively.  Simplify the
IgnorableOrderby() macro in the process.
Add the ability to use indices for the first few terms of an ORDER BY clause,
then sort in batches to handle the later terms.
Fix the ORDER BY optimization logic so that it will do a block-sort on
a partial DESC ORDER BY.  This enhancement uncovered a memory leak in
pushUntoSorter() which is also fixed.
Increase the version number to 3.8.5.
Clear the sort-order flags on the KeyInfo object associated with the
OP_Compare/OP_Jump of the block-sort logic, in order to make the OP_Jump
fully testable.