Skip to content

ES|QL: Merge QueryBuilder range filters #139191

@GalLalouche

Description

@GalLalouche

For example, if a QueryBuilder contains two different filters of the form: x > 1000 and 500 < x < 1500, we can merge it into just one filter 1000 < x < 1500, or in some cases, remove the filter altogether, e.g., as in x > 2000 and 500 < x < 1500.
In #138765, I introduced a QueryBuilder range filter merger, but only for a very specific use case (COUNT(*) BY ROUNDTO, basically). This was intentionally very conservative to minimize its impact, but there's no principal reason we couldn't perform this merging for any QueryBuilder! This makes pushing queries down to Lucene cheaper, since the queries themselves are simpler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions