File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1795,6 +1795,24 @@ void OptimizerRetrieval::getInversionCandidates(InversionCandidateList* inversio
17951795 for (int j = 0 ; j < scratch.idx ->idx_count ; j++)
17961796 {
17971797 IndexScratchSegment* segment = scratch.segments [j];
1798+
1799+ // Special case: IS NULL against the in-the-middle segment of the ascending compound index.
1800+ // In ODS11, such a retrieval is not better than the one for the prior segment. So stop before
1801+ // utilizing that segment and leave the boolean for other possible matches.
1802+ if (!(scratch.idx ->idx_flags & idx_descending) &&
1803+ segment->scanType == segmentScanMissing &&
1804+ j > 0 && j < scratch.idx ->idx_count - 1 )
1805+ {
1806+ IndexScratchSegment* const next_segment = scratch.segments [j + 1 ];
1807+
1808+ if (next_segment->scanType != segmentScanEqual &&
1809+ next_segment->scanType != segmentScanEquivalent &&
1810+ next_segment->scanType != segmentScanMissing)
1811+ {
1812+ break ;
1813+ }
1814+ }
1815+
17981816 if (segment->scope == scope) {
17991817 scratch.scopeCandidate = true ;
18001818 }
You can’t perform that action at this time.
0 commit comments