mirror of
https://github.com/cldellow/sqlite-parquet-vtable.git
synced 2025-09-16 22:49:59 +00:00
Short-circuit row group evaluation
We can avoid eagerly computing bitmasks for other constraints this way. Possible future work - order the constraints such that we evaluate the one that is cheapest/most likely to prune a row group first. This reduces the cyclist query from ~65ms to ~60ms
This commit is contained in:
@@ -517,7 +517,6 @@ bool ParquetCursor::currentRowSatisfiesDoubleFilter(Constraint& constraint) {
|
||||
// This avoids opening rowgroups that can't return useful
|
||||
// data, which provides substantial performance benefits.
|
||||
bool ParquetCursor::currentRowGroupSatisfiesFilter() {
|
||||
bool overallRv = true;
|
||||
for(unsigned int i = 0; i < constraints.size(); i++) {
|
||||
int column = constraints[i].column;
|
||||
int op = constraints[i].op;
|
||||
@@ -567,12 +566,12 @@ bool ParquetCursor::currentRowGroupSatisfiesFilter() {
|
||||
if(!rv) {
|
||||
constraints[i].bitmap.setEstimatedMembership(rowGroupId, rv);
|
||||
constraints[i].bitmap.setActualMembership(rowGroupId, rv);
|
||||
return rv;
|
||||
}
|
||||
overallRv = overallRv && rv;
|
||||
}
|
||||
|
||||
// printf("rowGroup %d %s\n", rowGroupId, overallRv ? "may satisfy" : "does not satisfy");
|
||||
return overallRv;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user