Skip to content

Reduce outer joins #2757

@HuSen8891

Description

@HuSen8891

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
For query: select ... from a left join b on ... where b.xx = 100;

if b.xx is null, and b.xx = 100 returns false, filterd those null rows.
Therefore, there is no need to produce null rows for output, we can use
inner join instead of left join.

we can optimize above query to select ... from a join b on ... where b.xx = 100;

Generally, right join/full join can also be reduced to inner join according to these rules.

such as
select ... from a right join b on .... where a.xx is not null; ===> select ... from a join b on .... where a.xx is not null;

Describe the solution you'd like
As above.

Describe alternatives you've considered
None

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions