Skip to content

Commit 81b63a5

Browse files
committed
test
1 parent cc2a0a1 commit 81b63a5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rust/cubestore/cubestore/src/queryplanner/planning.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1189,11 +1189,15 @@ async fn pick_index(
11891189
)));
11901190
(err, None, sort_on)
11911191
} else {
1192+
let filter_columns_updated = match sort_on_order_col_only {
1193+
Some(_) => HashSet::new(),
1194+
_ => filter_columns,
1195+
};
11921196
let optimal = optimal_index_by_score(
11931197
// Skipping default index
11941198
indices.iter().skip(1),
11951199
&projection_columns,
1196-
&filter_columns,
1200+
&filter_columns_updated,
11971201
);
11981202
let index = optimal.unwrap_or(default_index);
11991203
(
@@ -1274,7 +1278,7 @@ fn optimal_index_by_score<'a, T: Iterator<Item = &'a IdRow<Index>>>(
12741278
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
12751279
let res = match self.index_type {
12761280
IndexType::Regular => match other.index_type {
1277-
IndexType::Regular => core::cmp::Ordering::Less,
1281+
IndexType::Regular => core::cmp::Ordering::Equal,
12781282
IndexType::Aggregate => core::cmp::Ordering::Greater,
12791283
},
12801284
IndexType::Aggregate => match other.index_type {

0 commit comments

Comments
 (0)