Skip to content

Commit fb976a1

Browse files
perf[layout]: apply then filter (#5788)
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 7dcc3f7 commit fb976a1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vortex-layout/src/layouts/flat/reader.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ impl LayoutReader for FlatReader {
158158

159159
let array_mask = if *USE_VORTEX_OPERATORS {
160160
if mask.density() < FILTER_OF_FILTER_THRESHOLD {
161-
// Run only over the pre-filtered rows.
162-
let array = array.filter(mask.clone())?;
161+
// We have the choice to apply the filter or the expression first, we apply the
162+
// expression first so that it can try pushing down itself and then the filter
163+
// after this.
163164
let array = array.apply(&expr)?;
165+
let array = array.filter(mask.clone())?;
164166
let array_mask = array.execute_mask(&session)?;
165167

166168
mask.intersect_by_rank(&array_mask)

0 commit comments

Comments
 (0)