Expand description
Sum-index pickers. Parallels count’s index_picker.rs.
Two pickers:
find_summable_index_for_where_clauses: returns the index whose summed value equals the request’ssum_propertyand whose properties the Equal/In where-clause fields exactly match, or, on asummableOffCountIndexindex, cover as a prefix it can read whole: a prefix reaching its sum chain (the deepest pin’s value tree) or every property but the last (the last property’s tree). None on miss.find_range_summable_index_for_where_clauses: returns therangeSummable: trueindex whose Equal/In prefix covers the non-range clauses AND whose last property is the range terminator. None on miss.
Reject-on-miss is the load-bearing contract: callers landing in
“no covering index” return WhereClauseOnNonIndexedProperty so the
prover and verifier reject the same set of inputs (same as count).
Functions§
- find_
range_ summable_ index_ for_ where_ clauses - Find a
rangeSummable: trueindex whose properties cover the non-range Equal/In clauses as a prefix AND whose last property is the range terminator. The summed property must matchsum_property. - find_
range_ summable_ index_ with_ counts_ for_ where_ clauses find_range_summable_index_for_where_clausesfor a range average or count-and-sum read: the picked index must also berangeCountable. AsummableOffCountIndexindex that is not is passed over, so it never hides, by name order, one that is. A regular index is picked first and judged after, as before protocol version 14, so a query over regular indexes keeps resolving to the index released verifiers rebuild.- find_
summable_ index_ for_ where_ clauses - Find an index whose summed value equals the request’s
sum_propertyand whose properties the Equal/In where-clause fields exactly cover, or, on asummableOffCountIndexindex, cover as a prefix it reads whole (seefind_summable_index_accepted_by). - find_
summable_ index_ with_ counts_ for_ where_ clauses find_summable_index_for_where_clausesfor an average or count-and-sum read: the picked index’s read element must also carry a count ([summable_point_lookup_carries_counts]). AsummableOffCountIndexindex that cannot answer is passed over, so it never hides, by name order, one that can. A regular index is picked first and judged after, as before protocol version 14, so a query over regular indexes keeps resolving to the index released verifiers rebuild.