Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ OUTER JOIN optimization #2447

Open
joocer opened this issue Feb 21, 2025 · 0 comments
Open

✨ OUTER JOIN optimization #2447

joocer opened this issue Feb 21, 2025 · 0 comments
Labels
⚙️ Query Optimizer Component Label - Optimizer

Comments

@joocer
Copy link
Contributor

joocer commented Feb 21, 2025

REDUNDANCY RULE

we can rewrite an outer join to an inner join if the query contains a filter that would already reject any null values (which is most filters)

SELECT s.id, p.id FROM $satellites AS s LEFT JOIN $planets AS p ON s.id = p.id WHERE p.id = 5

is the same as

SELECT s.id, p.id FROM $satellites AS s INNER JOIN $planets AS p ON s.id = p.id WHERE p.id = 5
@joocer joocer added the ⚙️ Query Optimizer Component Label - Optimizer label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Query Optimizer Component Label - Optimizer
Projects
None yet
Development

No branches or pull requests

1 participant