Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue with in / = on indexed property #7027

Open
themajashurka opened this issue Mar 10, 2024 · 3 comments
Open

Performance issue with in / = on indexed property #7027

themajashurka opened this issue Mar 10, 2024 · 3 comments

Comments

@themajashurka
Copy link

  • EdgeDB Version: 4.5+9324bab
  • EdgeDB CLI Version: 4.1.0+c3b6bc7
  • OS Version: macos 11.7.10

Steps to Reproduce:

With a populated (1M items) table,

  1. it takes 130ms to run
select A
filter .value in {'0.26215992867653615'}
  1. it takes 330ms to run
select A
filter .value = array_unpack(['0.26215992867653615'])
  1. it takes no time (0.05ms) to run:
select A
filter .value in array_unpack(['0.26215992867653615'])
select A
filter .value = '0.26215992867653615'

Schema:

type A {
    required property value -> str {
        constraint exclusive;
    }
    property detail -> str;
}
@themajashurka
Copy link
Author

themajashurka commented Mar 10, 2024

It behaves the same with params instead of inlining .value:

with
  value := <str>$value
select A
filter .value ...

@jollygreenlaser
Copy link

I've also encountered this: #6668 - in is causing it to ignore the index

@themajashurka
Copy link
Author

themajashurka commented Mar 22, 2024

I've also encountered this: #6668 - in is causing it to ignore the index

What really interesting, is that wrapping the inlined data in array_unpack speeds up my example (130ms -> 0.05ms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants