Skip to content

Conversation

Mytherin
Copy link
Collaborator

During row group checks - we keep track of which filters are always true (and hence do not need to be checked during the actual scan). Due to a missing else statement, we could call this method twice for the same filter.

Now this doesn't look problematic, but in SetFilterAlwaysTrue we also keep track of how many filters have been set as being always true - and if all filters are set as being always true, the filters are skipped entirely.

This can cause problems when optional filters (as e.g. constructed due to a Top-N) are combined with non-optional filters (as e.g. constructed through a WHERE clause). The filter would not be correctly executed - leading to incorrect rows sneaking into the result.

@Mytherin Mytherin merged commit 2ba2b65 into duckdb:v1.2-histrionicus Feb 17, 2025
48 checks passed
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Mar 7, 2025
Avoid calling SetFilterAlwaysTrue multiple times in RowGroup::CheckZonemap (duckdb/duckdb#16269)
@Mytherin Mytherin deleted the filterpruningfix branch April 2, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant