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

PgSelect step is not deduplicating #2303

Open
jcgsville opened this issue Jan 6, 2025 · 1 comment
Open

PgSelect step is not deduplicating #2303

jcgsville opened this issue Jan 6, 2025 · 1 comment
Labels

Comments

@jcgsville
Copy link
Contributor

Summary

When doing xByRowId queries with the same constant ID, pgSelect step does not seem to correctly deduplicate

Screenshot 2025-01-06 at 12 00 37 PM

Steps to reproduce

Setup Postgraphile v5. Add a table with the ability to do a root query to fetch a single row of that table by its row ID

create table foo (id int primary key, a text);

Set graphile.explain to true in your preset

Execute a query in Ruru using aliases to query the same row twice. e.g.

query MyFoos {
  foo1: foo(id="1") {
    id
  }
  foo2: foo(id="1") {
    id
  }
}

See the diagram of the plan is similar to the screenshot above

Please let me know if it would be useful to create a minimal repro of this. I'm happy to do so

Expected results

I expect there to be a single PgSelect step in the plan

Actual results

There are 2 PgSelect steps

Additional context

Additional discussion in this discord thread:

https://discord.com/channels/489127045289476126/1325736426587033652/1325879877576032288

Possible Solution

Not sure without digging into PgSelect code

@github-project-automation github-project-automation bot moved this to 🌳 Triage in V5.0.0 Jan 6, 2025
@benjie benjie moved this from 🌳 Triage to 🦟 Mayfly in V5.0.0 Jan 8, 2025
@benjie
Copy link
Member

benjie commented Jan 8, 2025

Likely a bug in the deduplicate method in PgSelectStep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🦟 Mayfly
Development

No branches or pull requests

2 participants