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

Eager load domains for routes associated with a process #3372

Merged

Conversation

philippthun
Copy link
Member

The routes association in the process model is used to determine the uris belonging to a process. This also requires the name from the associated domain which leads to 1 + n SELECT queries (1 * SELECT FROM routes + n * SELECT FROM domains), where n is the number of associated routes. When eager loading domains, there are only 2 SELECT queries no matter how many routes are associated with a process.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

The 'routes' association in the 'process' model is used to determine the
'uris' belonging to a process. This also requires the 'name' from the
associated 'domain' which leads to 1 + n SELECT queries (1 * SELECT FROM
routes + n * SELECT FROM domains), where n is the number of associated
routes. When eager loading domains, there are only 2 SELECT queries no
matter how many routes are associated with a process.
@philippthun
Copy link
Member Author

Thanks for finding this, @chombium!

@chombium
Copy link
Contributor

chombium commented Aug 5, 2023

Thank you too for fixing the problem that soon @philippthun ;)

Copy link
Member

@tcdowney tcdowney left a comment

Choose a reason for hiding this comment

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

LGTM!

@tcdowney
Copy link
Member

@philippthun @moleske do y'all think this is good to merge?

@moleske moleske merged commit a76154c into cloudfoundry:main Aug 17, 2023
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.

5 participants