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

Use permissions subqueries in service list fetchers #2580

Conversation

philippthun
Copy link
Member

@philippthun philippthun commented Dec 2, 2021

Add readable_orgs_query and readable_space_scoped_spaces_query to Permissions and use them as input to ServiceOfferingListFetcher.fetch and ServicePlanListFetcher.fetch.

When running the cf-performance-tests locally, improvements for the following endpoints could be observed:

Request before after
GET /v3/service_plans as regular user 20.756 2.473
GET /v3/service_plans?service_offering_guids=... as regular user 1.382 0.362
  • 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

Add readable_orgs_query and readable_space_scoped_spaces_query to
Permissions and use them as input to ServiceOfferingListFetcher.fetch
and ServicePlanListFetcher.fetch.
@philippthun philippthun marked this pull request as ready for review December 3, 2021 10:30
@sethboyles sethboyles self-assigned this Dec 10, 2021
@philippthun philippthun merged commit e7ee2ee into cloudfoundry:main Dec 13, 2021
johha added a commit to sap-contributions/cloud_controller_ng that referenced this pull request Dec 14, 2022
As a regular user the select query for service credential bindings is
filtered by a list of space guids (spaces the user has access to).
This can produce very long queries. Instead we can use subqueries to filter the spaces directly in the db.
Same approach is used in service lists, see cloudfoundry#2580.
johha added a commit to sap-contributions/cloud_controller_ng that referenced this pull request Dec 14, 2022
As a regular user the select query for service credential bindings is
filtered by a list of space guids (spaces the user has access to).
This can produce very long queries. Instead we can use subqueries to filter the spaces directly on the db.
The same approach is used in the list services endpoint, see cloudfoundry#2580.
johha added a commit to sap-contributions/cloud_controller_ng that referenced this pull request Dec 15, 2022
As a regular user the select query for service credential bindings is
filtered by a list of space guids (spaces the user has access to).
This can produce very long queries. Instead we can use subqueries to filter the spaces directly on the db.
The same approach is used in the list services endpoint, see cloudfoundry#2580.
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.

None yet

3 participants