Skip to content

IN queries are automatically converted in ANY queries and break the query planner #2605

@hanrelan

Description

@hanrelan

Code of Conduct

  • I agree to follow this project's Code of Conduct

AI Policy

  • I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.

Versions

Elixir 1.19
Erlang/OTP 28
Postgres 14

Operating system

All

Current Behavior

The issue is discussed here:
https://discord.com/channels/711271361523351632/711271361523351636/1470999522766487654

Essentially Ash converts "IN" queries into "ANY" queries (eg. practice_id IN (...) becomes s1."practice_id" = ANY('{...}'::uuid[]). Unfortunately this breaks the query planning postgres in weird ways and results in very suboptimal queries. It would be good if there was a way to force it to be an IN query and not allow the rewrite

Reproduction

No response

Expected Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions