Skip to content

Commit

Permalink
opt: prove partial index implication in scanIndexIter
Browse files Browse the repository at this point in the history
This commit updates `scanIndexIter` in order to make it safer to reduce
filters during partial index implication. The goal is to help avoid the
common mistake of using filters for an enumerated index that were
reduced in a previous iteration. Another benefit of these changes is
that code for checking filter/predicate implication has been
de-duplicated and moved into `scanIndexIter`.

The `Next` and for-loop iteration pattern has been replaced with a
`ForEach` and callback pattern. Partial indexes are only enumerated if
their partial indexes are implied by the provided filters. Filters
reduced during partial index implication are passed to the callback
function.

`HasInvertedIndexes` and `canMaybeConstrainIndexWithCols` previously
used the `scanIndexIter` for simple iteration. They no longer do to
avoid over complicating the `scanIndexIter` with features to halt
iteration and ignore partial index implication.

Release note: None
  • Loading branch information
mgartner committed Oct 15, 2020
1 parent d8a4d5f commit 4eeae0a
Show file tree
Hide file tree
Showing 2 changed files with 255 additions and 330 deletions.
Loading

0 comments on commit 4eeae0a

Please sign in to comment.