Skip to content

Use prefix comparison for starts_with #4458

@lutter

Description

@lutter

A GraphQL query that contains a clause name_starts_with: .. gets translated to SQL as name like '...%'. On String and Bytes columns, we only index a prefix of these columns so that the index is not usable for that clause.

Query generation should be changed to generate something like left(name, 256) like '...%' if the search term is shorter than 256 characters, and to left(name, 256) = left('...', 256) and name like '...%' if the search term is longer than that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions