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

Improve Gremlin schema sync performance #498

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

kmcginnes
Copy link
Collaborator

@kmcginnes kmcginnes commented Jul 16, 2024

Description

  • Improve vertex schema template query by using union
  • Improved formatting for edge schema template (no query changes)
  • Move the summary API request in to a function
  • Add logger util, which is a thin wrapper around console.log() for now
  • Add debug logging around schema fetching for Gremlin Explorer
  • Fix global mock for ./utils/env

Before

g.V()
  .project("airport", "country")
  .by(V().hasLabel("airport").limit(1))
  .by(V().hasLabel("country").limit(1))
  .limit(1);

After

g.V().union(
  __.hasLabel("airport").limit(1),
  __.hasLabel("country").limit(1)
)
.fold()
.project("airport", "country")
.by(unfold().hasLabel("airport"))
.by(unfold().hasLabel("country"))

Validation

  • Tested on small database
  • Tested on large database (schema sync in roughly 1 second)

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0
    license.
  • I have run pnpm checks to ensure code compiles and meets standards.
  • I have run pnpm test to check if all tests are passing.
  • I have covered new added functionality with unit tests if necessary.
  • I have added an entry in the Changelog.md.

@kmcginnes kmcginnes marked this pull request as ready for review July 16, 2024 23:46
@kmcginnes kmcginnes merged commit 44d6ac8 into aws:main Jul 17, 2024
1 check passed
@kmcginnes kmcginnes deleted the schema-sync-improvements branch July 17, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants