Skip to content

store: Check interface uniqueness in bulk #5293

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

Merged
merged 1 commit into from
May 1, 2024
Merged

Conversation

lutter
Copy link
Collaborator

@lutter lutter commented Mar 21, 2024

We used to run one query for each entity that was created or updated if it was of a type that implemented an interface. These single-entity queries can become quite time consuming during syncing.

With this change, we check all the entities of a given type with a single query, so that uniqueness checking for interfaces causes as many queries as there are types (with new/updated entities) rather than as many as there are entities of such types.

@fordN fordN requested a review from zorancv April 15, 2024 16:00
@lutter lutter force-pushed the lutter/intf-uniq branch from 679abdc to 0a8f286 Compare April 15, 2024 18:51
@lutter
Copy link
Collaborator Author

lutter commented Apr 15, 2024

Rebased to latest master and fixed a test failure. The test postgres::graft::graft was failing because it used an entity type from the source schema, where User implements an interface, but in the destination subgraph, User doesn't implement any interfaces, and the test failed because it was checking for a non-existent interface

We used to run one query for each entity that was created or updated if it
was of a type that implemented an interface. These single-entity queries
can become quite time consuming during syncing.

With this change, we check all the entities of a given type with a single
query, so that uniqueness checking for interfaces causes as many queries as
there are types (with new/updated entities) rather than as many as there
are entities of such types.
@lutter lutter force-pushed the lutter/intf-uniq branch from 0a8f286 to 94122ff Compare May 1, 2024 18:37
@lutter lutter merged commit 94122ff into master May 1, 2024
@lutter lutter deleted the lutter/intf-uniq branch May 1, 2024 20:59
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

Successfully merging this pull request may close these issues.

2 participants