File tree 1 file changed +6
-2
lines changed
rust/cubestore/cubestore/src/queryplanner
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1189,11 +1189,15 @@ async fn pick_index(
1189
1189
) ) ) ;
1190
1190
( err, None , sort_on)
1191
1191
} else {
1192
+ let filter_columns_updated = match sort_on_order_col_only {
1193
+ Some ( _) => HashSet :: new ( ) ,
1194
+ _ => filter_columns,
1195
+ } ;
1192
1196
let optimal = optimal_index_by_score (
1193
1197
// Skipping default index
1194
1198
indices. iter ( ) . skip ( 1 ) ,
1195
1199
& projection_columns,
1196
- & filter_columns ,
1200
+ & filter_columns_updated ,
1197
1201
) ;
1198
1202
let index = optimal. unwrap_or ( default_index) ;
1199
1203
(
@@ -1274,7 +1278,7 @@ fn optimal_index_by_score<'a, T: Iterator<Item = &'a IdRow<Index>>>(
1274
1278
fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
1275
1279
let res = match self . index_type {
1276
1280
IndexType :: Regular => match other. index_type {
1277
- IndexType :: Regular => core:: cmp:: Ordering :: Less ,
1281
+ IndexType :: Regular => core:: cmp:: Ordering :: Equal ,
1278
1282
IndexType :: Aggregate => core:: cmp:: Ordering :: Greater ,
1279
1283
} ,
1280
1284
IndexType :: Aggregate => match other. index_type {
You can’t perform that action at this time.
0 commit comments