feat(optimizer): Optimize constant false filters to empty ValuesTable#1016
Open
marxhxxx wants to merge 2 commits intofacebookincubator:mainfrom
Open
feat(optimizer): Optimize constant false filters to empty ValuesTable#1016marxhxxx wants to merge 2 commits intofacebookincubator:mainfrom
marxhxxx wants to merge 2 commits intofacebookincubator:mainfrom
Conversation
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 6, 2026
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `output` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 6, 2026
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `output` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 6, 2026
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `output` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 6, 2026
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `output` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
859621a to
9243b8c
Compare
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 6, 2026
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `output` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
aae6bc5 to
89f0369
Compare
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 6, 2026
…facebookincubator#1016) Summary: Pull Request resolved: facebookincubator#1016 Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `output` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 6, 2026
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `output` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
added 2 commits
March 10, 2026 11:51
…ator#967) Summary: When a JOIN has a constant false conjunct in the ON clause (e.g., `1 > 2`), we can optimize the join based on join type: Already supported: - **LEFT JOIN**: Remove the right side and project NULLs for right columns. (already handled) - **RIGHT JOIN**: Remove the left side and project NULLs for left columns. (already handled) In this change: - **FULL JOIN**: Transform into UNION ALL of (left with NULLs for right) and (right with NULLs for left). (NEW) TODO: INNER JOIN: No rows can ever match, so replace with an empty ValuesTable. Differential Revision: D94445313
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `emptyValuesType` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
89f0369 to
57ba32d
Compare
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 10, 2026
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `emptyValuesType` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
marxhxxx
pushed a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 10, 2026
…facebookincubator#1016) Summary: Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `emptyValuesType` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
marxhxxx
added a commit
to marxhxxx/axiom
that referenced
this pull request
Mar 10, 2026
…facebookincubator#1016) Summary: Pull Request resolved: facebookincubator#1016 Extends `addFilter` in `ToGraph` to detect constant false conjuncts in filter predicates. When the optional `emptyValuesType` parameter is provided and a false conjunct is found, replaces the plan with an empty ValuesTable matching the output schema, avoiding unnecessary table scans for queries like `SELECT * FROM t WHERE false` or `WHERE 1 > 2`. Differential Revision: D95446850
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Extends
addFilterinToGraphto detect constant false conjuncts infilter predicates. When the optional
outputparameter is provided and afalse conjunct is found, replaces the plan with an empty ValuesTable
matching the output schema, avoiding unnecessary table scans for queries
like
SELECT * FROM t WHERE falseorWHERE 1 > 2.Differential Revision: D95446850