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

feat: Avoid joins when only fetching an ID #483

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mselee
Copy link

@mselee mselee commented Feb 18, 2024

Description

Consider the following query

query Query {
  books {
    id
    author {
      id
    }
  }
}

A join will be generated even though we really don't have to, as the required information already exists through book.author_id.
The idea here is to try and optimize away this join, by constructing the Author object in-memory using the value from book.author_id.

I'm not very familiar with the code base, so I'm not sure if this is has other drawbacks.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@Sanyambansal76
Copy link

@mselee want to check if you are waiting for help to update the PR?

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.

2 participants