Skip to content

[Feature] Optimize BTree global index reads for negative predicates #8944

Description

@zhoulii

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Negative predicates such as IS NOT NULL, !=, and NOT IN currently require reading all non-null BTree index files. This causes unnecessary index file reads when only a small number of files contain null values or the specified literals.

Solution

For BTree global indexes, evaluate negative predicates as a complement of the current row-id range. Exclude rows returned by IS NULL and the corresponding positive predicate (= or IN), while preserving SQL null semantics. Fall back to the existing behavior when the required positive predicates are unsupported.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

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