Skip to content

Shacl optimization - #792

Merged
zonotope merged 14 commits into
mainfrom
feature/index-queue-integration
Jun 1, 2024
Merged

zonotope merged 14 commits into
mainfrom
feature/index-queue-integration

Conversation

@zonotope

@zonotope zonotope commented May 31, 2024 •

Copy link
Copy Markdown
Contributor

This patch ensures that we run a query for shacl shapes present in a db only once while validating the set of modified subjects in a transaction, and that we bypass shacl all together if there are no shapes to validate.

There's also an optimization for new index jobs processed in the index queue to always use the latest known index before processing the new indexing job. This should prevent the indexer from repeating work it has already done.

this patch depends on #785, so please review that one first.

@zonotope
zonotope requested a review from a team May 31, 2024 16:21

@dpetran dpetran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding correctly, these are the optimizations:

For SHACL, we only look up the shape sids once, instead for every single subject in the transaction.

Also, when processing a db from index queue we'll make sure to assoc in the most recent index, instead of whatever the index was when the db was put on the indexing queue.

Base automatically changed from feature/dataset-protocol-impls to main June 1, 2024 16:09
@zonotope

zonotope commented Jun 1, 2024

Copy link
Copy Markdown
Contributor Author

If I'm understanding correctly, these are the optimizations:

For SHACL, we only look up the shape sids once, instead for every single subject in the transaction.

Also, when processing a db from index queue we'll make sure to assoc in the most recent index, instead of whatever the index was when the db was put on the indexing queue.

Not quite for the second one. We don't assoc in the recent index because that wouldn't actually build the index in the db. We reload the db with the recent index so both the index roots and novelty are correct.

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.

3 participants