To support pagination, we need to be able to restart a search from a
particular sort key. In the SQL index implementation, this is done
using a combination of rewrite rules and ChangeAccess methods for
scanning around the sort key. This approach does not quite work for
the secondary index, which is much less rewrite-heavy.
Teach IndexedChangeQuery to replace SortKeyPredicate leaves in a
predicate tree with a new predicate having a different cut point. This
is a simple recursive algorithm since we explicitly do not try to deal
with the case of multiple sort key predicates in different subtrees.
Such queries are already documented to have unpredictable behavior
(since in the SQL implementation it is non-obvious which of a number
of such predicates is chosen as the source and which are used for
filtering).
Change-Id: Ia839eb21086b64be2bebdcc71aa579b8c99a2fd8