Skip to content

Optimizer: IS NULL optimization #1342

@liukun4515

Description

@liukun4515

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The expr column is null can be optimize if the column is not null in the schema.

If a WHERE clause includes a col_name IS NULL condition for a column that is declared as NOT NULL, that expression is optimized away.

Describe the solution you'd like

In the PG database

  1. create table
create table t1(c1 int not null, c2 int not null);

  1. select with filter
select * from where c1 is null;

The expr c1 is null can be optimized as false away.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions