@@ -877,10 +877,6 @@ void Retrieval::getInversionCandidates(InversionCandidateList& inversions,
877
877
// We can't use the next segments, and we'll need to use
878
878
// INTL_KEY_PARTIAL to construct the last segment's key.
879
879
scratch.usePartialKey = true ;
880
-
881
- // It's currently impossible to use a list scan with INTL_KEY_PARTIAL
882
- if (scanType == segmentScanList)
883
- scanType = segmentScanNone;
884
880
}
885
881
}
886
882
@@ -931,16 +927,14 @@ void Retrieval::getInversionCandidates(InversionCandidateList& inversions,
931
927
932
928
// An equality scan for any unique index cannot retrieve more
933
929
// than one row. The same is true for an equivalence scan for
934
- // any primary index.
935
- const bool single_match =
930
+ // any primary index. A missing scan for any primary index is
931
+ // known to return no rows, but let's treat it the same way.
932
+ const bool uniqueMatch =
936
933
(scanType == segmentScanEqual && (idx->idx_flags & idx_unique)) ||
937
- (scanType == segmentScanEquivalent && (idx->idx_flags & idx_primary));
938
-
939
- // dimitr: IS NULL scan against primary key is guaranteed
940
- // to return zero rows. Do we need yet another
941
- // special case here?
934
+ (scanType == segmentScanEquivalent && (idx->idx_flags & idx_primary)) ||
935
+ (scanType == segmentScanMissing && (idx->idx_flags & idx_primary));
942
936
943
- if (single_match && ((j + 1 ) == idx->idx_count ))
937
+ if (uniqueMatch && ((j + 1 ) == idx->idx_count ))
944
938
{
945
939
// We have found a full equal matching index and it's unique,
946
940
// so we can stop looking further, because this is the best
0 commit comments