Optimize Gremlin schema sync queries for large graphs#1805
Merged
Conversation
Both vertex and edge schema templates now use g.V().limit(1) as a dummy anchor instead of g.E() / g.V().union().fold(). The .by() modulators run independent global sub-traversals so the anchor value is irrelevant, but this change ensures Neptune's DFE engine handles the full query natively on all tested versions (1.2.1.0, 1.3.5.0, 1.4.7.0). Closes #1803
Cole-Greer
approved these changes
Jun 4, 2026
Contributor
Cole-Greer
left a comment
There was a problem hiding this comment.
The updated query templates look good to me. Looks like the patterns to follow given Graph Explorer's need to support such a broad range of gremlin versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Both vertex and edge schema templates now use
g.V().limit(1)as a dummy anchor instead ofg.E()(edges) andg.V().union().fold()(vertices). Each.by()modulator runs an independent global sub-traversal that doesn't depend on the anchor value, so this is semantically equivalent. The change ensures Neptune's DFE engine handles the full query natively, avoiding fallback to slower execution paths.Validation
pnpm checkspasses (lint, format, types)Related Issues
Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.