Teach secondary index to handle boolean queries
Modify ChangeIndex.getSource() to allow And/Or/NotPredicates in
addition to IndexPredicates, and convert these to the appropriate
index-specific query types.
Add a preliminary rewrite step before the manual rewrite steps in
ChangeQueryRewriter. This step attempts to find maximal subtrees that
contain only boolean operations on IndexPredicates, i.e. exactly those
subtrees that can now be queried in the index.
The rewrite step is smart enough to partition children of a single
boolean node into index/non-index predicates, but not smart enough to
rearrange the tree structure beyond that. For each IndexPredicate
type, determine whether it is only satisfiable by looking at the
index; when partitioning children, a non-index-only predicates may be
duplicated to remain as a hint to the database-based rewrite step.
Change-Id: Ifc9e94f87388764781fdc3f50aba0286829c33c9
12 files changed