File tree 1 file changed +3
-3
lines changed 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ bool SkiplistIndexAttributeMatcher::supportsFilterCondition(
196
196
size_t attributesCoveredByEquality = 0 ;
197
197
double equalityReductionFactor = 20.0 ;
198
198
estimatedCost = static_cast <double >(itemsInIndex);
199
-
199
+
200
200
for (size_t i = 0 ; i < idx->fields ().size (); ++i) {
201
201
auto it = found.find (i);
202
202
@@ -250,7 +250,7 @@ bool SkiplistIndexAttributeMatcher::supportsFilterCondition(
250
250
if (values == 0 ) {
251
251
values = 1 ;
252
252
}
253
-
253
+
254
254
if (attributesCoveredByEquality == idx->fields ().size () &&
255
255
(idx->unique () || idx->implicitlyUnique ())) {
256
256
// index is unique and condition covers all attributes by equality
@@ -335,7 +335,7 @@ bool SkiplistIndexAttributeMatcher::supportsFilterCondition(
335
335
// lookup cost is O(log(n))
336
336
estimatedCost = (std::max)(static_cast <double >(1 ), std::log2 (static_cast <double >(itemsInIndex)) * values);
337
337
// slightly prefer indexes that cover more attributes
338
- estimatedCost -= (idx-> fields (). size () - 1 ) * 0.01 ;
338
+ estimatedCost -= (attributesCovered - 1 ) * 0.02 ;
339
339
}
340
340
return true ;
341
341
}
You can’t perform that action at this time.
0 commit comments