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

Reduce queries for published graphs when indexing #11513

Draft
wants to merge 1 commit into
base: dev/8.0.x
Choose a base branch
from

Conversation

jacobtylerwalls
Copy link
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

Before, when indexing resources there were 2 queries per graph to get the published graph in the active language. One for the GraphXPublishedGraph row, one for the PublishedGraph row. This was then cached in memory, persisting either for a short period (on the CLI) or potentially forever for server-side operations, which could lead to retrieving stale data.

Now, these are prefetched during optimize_resource_iteration, so that it takes 2 queries total per chunk, no matter how many graphs are involved. A typical chunk size is 500 (2000 // 8), so if two adjacent chunks each contain 500 resources of the same graph, then this might slightly increase queries, because we are no longer perpetually caching, but with a benefit of less memory overhead and better correctness for server-side operations--but in all other cases this should reduce queries by avoiding repetitive published graph queries.

Checklist

  • I targeted one of these branches:
    • dev/8
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Ticket Background

@jacobtylerwalls jacobtylerwalls requested review from apeters and removed request for chiatt October 15, 2024 22:41
@jacobtylerwalls
Copy link
Member Author

After pairing with @apeters on this, I think we're going to go in the direction of:

  • pulling this query for published graphs out of the resource batch iteration and do it earlier, passing the result as an arg to index_resources_using_singleprocessing

@jacobtylerwalls jacobtylerwalls marked this pull request as draft October 17, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant