Skip to content

Feature Request: Improve Vitess rewriter to simplify queries further. #14058

@GuptaManan100

Description

@GuptaManan100

Feature Description

For a query like select 1 from t1 where (false or (false or a in (1))), I noticed that Vitess simplifies the query into select 1 from t1 where false or a in (1).

The query, however, can be further simplified into select 1 from t1 where a in (1).

There are benefits of simplifying the query which can further lead to more simplifications and even merging queries together. Vitess in general works better with AND clauses and not so much with ORs, so the more we can eliminate the better.

Use Case(s)

The simplification of queries is better for better performance, or just in general too even if there is no performance impact.

Also, this is going to be used in a upcoming Foreign key PR :sung

Metadata

Metadata

Assignees

No one assigned

    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