Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lutter
Copy link
Collaborator

@lutter lutter commented Aug 24, 2023

If a query only needs to get the id of children, and we already have them in memory, do not run a query to fetch them again. Instead, construct the appropriate objects in memory.

Fixes #4261

@fordN fordN requested a review from mangas August 28, 2023 15:53
@lutter
Copy link
Collaborator Author

lutter commented Aug 31, 2023

@mangas Thanks for approving - I added one more commit to have a feature flag to turn all this off. Not sure if you want to have another look.

We used to omit entries for parents that have no children from the
`ParentLink` which would violate the constraint that the child/children for
the ith parent is in the ith place in the list of child ids.

That is not a problem for the SQL queries we generate, but can be an issue
for other uses of the data structure.
If a query only needs to get the id of children, and we already have them
in memory, do not run a query to fetch them again. Instead, construct the
appropriate objects in memory.

Fixes #4261
Setting GRAPH_STORE_DISABLE_CHILD_OPTIMIZATION=1 will disable the child
optimization. This is meant as a safety switch in case the optimization
causes problems.
@lutter lutter merged commit 9c65a8d into master Sep 6, 2023
@lutter lutter deleted the lutter/children branch September 6, 2023 18:43
lutter added a commit that referenced this pull request Sep 6, 2023
This is a follow-on to
#4827 to cover the
important case where no ordering is specified (for example, for
single-value child fields)
lutter added a commit that referenced this pull request Sep 8, 2023
This is a follow-on to
#4827 to cover the
important case where no ordering is specified (for example, for
single-value child fields)
@lutter lutter mentioned this pull request Sep 11, 2023
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.

Optimize lookup of certain child ids

3 participants