Skip to content

Optimize ServiceInstanceListFetcher#4223

Merged
johha merged 1 commit intocloudfoundry:mainfrom
sap-contributions:service-instance-list-fetcher-union
Mar 11, 2025
Merged

Optimize ServiceInstanceListFetcher#4223
johha merged 1 commit intocloudfoundry:mainfrom
sap-contributions:service-instance-list-fetcher-union

Conversation

@philippthun
Copy link
Member

@philippthun philippthun commented Feb 19, 2025

Reduce the overall query complexity by fetching instances and shared instances separately. Apply filters (e.g. for readability) to each dataset instead of JOINing them and having multiple WHERE conditions. UNION the two datasets to get the final result set.

On large foundations this reduces the query execution time from multiple 100ms to less than 100ms.

  • 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

@philippthun philippthun marked this pull request as ready for review February 25, 2025 13:34
Reduce the overall query complexity by fetching instances and shared
instances separately. Apply filters (e.g. for readability) to each
dataset instead of JOINing them and having multiple WHERE conditions.
UNION the two datasets to get the final result set.

On large foundations this reduces the query execution time from multiple
100ms to less than 100ms.
@philippthun philippthun force-pushed the service-instance-list-fetcher-union branch from 344abca to c9163a4 Compare February 25, 2025 13:42
Copy link
Contributor

@kathap kathap left a comment

Choose a reason for hiding this comment

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

LGTM

@johha johha merged commit 2b6b992 into cloudfoundry:main Mar 11, 2025
8 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Mar 11, 2025
Changes in cloud_controller_ng:

- Optimize ServiceInstanceListFetcher
    PR: cloudfoundry/cloud_controller_ng#4223
    Author: Philipp Thun <[email protected]>
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.

3 participants