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

Explicit joins (on backlinks?) are slow (possible 6.x regression) #8520

Open
elprans opened this issue Mar 28, 2025 · 0 comments
Open

Explicit joins (on backlinks?) are slow (possible 6.x regression) #8520

elprans opened this issue Mar 28, 2025 · 0 comments

Comments

@elprans
Copy link
Member

elprans commented Mar 28, 2025

Given this schema:

type Bar;
type Foo {
  required bar: Bar;
};

The following query appears to be triggering a seqscan on Bar

select (select Foo filter .id = <uuid>"some-id") {
  comp := (
    with sourceId := .id
    select Bar
    filter .<bar[is Foo].id = sourceId
  )
};
  │     Time           Cost  Loops  Rows  Width │ Plan Info
┬ │   1586.4     8461728.11    1.0   1.0     32 │ ➊ IndexOnlyScan relation_name=Foo, scan_direction=Forward,
│ │                                             │ index_name=constraint 'std::exclusive' of property 'id' of object type 'default::Foo'
╰ │   1586.4     8461723.66    1.0   1.0     32 │ ➋ Aggregate strategy=Plain, partial_mode=Simple
  │   1586.4     8460473.64    1.0   1.0     16 │ SeqScan relation_name=Bar

For some additional context, this is a simplified version of a query that the UI data inspector runs when working on required links with access policies (to side-step the "required link 'bar' is hidden by access policy" error).

@msullivan msullivan changed the title Explicit joins are slow (possible 6.x regression) Explicit joins (on backlinks?) are slow (possible 6.x regression) Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants