Skip to content

Fix/speedup service brokers get endpoint#5098

Open
serdarozerr wants to merge 2 commits into
cloudfoundry:mainfrom
sap-contributions:fix/speedup-service-brokers-get-endpoint
Open

Fix/speedup service brokers get endpoint#5098
serdarozerr wants to merge 2 commits into
cloudfoundry:mainfrom
sap-contributions:fix/speedup-service-brokers-get-endpoint

Conversation

@serdarozerr
Copy link
Copy Markdown
Contributor

During get request to service_brokers endpoint, if service broker is associated with space, it fetch also space information, that leads to N+1 query problem. With this PR we add eager loading for :space association to load all the necessary space information with 1 query.

  • 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

When service broker space scoped, during build_relationships inside service_broker_presenter.rb it makes select query for each of them and that makes N+1 problem. With eager loading it would be adding all the spaces as association into service broker so it won't make queries anymore will just fetch from cache.
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.

1 participant