Skip to content

Optimize array_has() for scalar needle #20377

Description

@neilconway

Is your feature request related to a problem or challenge?

For the scalar needle case, array_has is reasonably fast but it could be optimized by avoiding the per-row work that is currently done to construct the result set (construct a slice into a BooleanArray and count the set bits).

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. neilconway commented on Feb 16, 2026

    @neilconway
    ContributorAuthor

    take

  2. neilconway commented on Feb 16, 2026

    @neilconway
    ContributorAuthor

    See also #18181, although in that case the observed performance issue is actually with array_has_any.

  3. added a commit that references this issue on Feb 20, 2026
    0294a22
  4. added a commit that references this issue on Mar 24, 2026
    7eefa17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions