🎨 Optimize storage access layer: replace GROUP BY subquery with EXISTS in get_readable_project_ids#9031
Conversation
|
There was a problem hiding this comment.
Pull request overview
Optimizes project readability queries by replacing GROUP BY-based access-rights subqueries with correlated EXISTS predicates, aligning storage-service access-layer behavior with the previously optimized webserver project listing approach.
Changes:
- Refactors storage
_list_user_projects_access_rights_with_read_accessto use EXISTS for read-access filtering. - Updates webserver legacy projects repository to use EXISTS for access-rights checks and to split folder-scope logic into ROOT/SPECIFIC/ALL query shapes.
- Adds/extends unit tests in both webserver and storage to cover folder-scope behavior and readable-project-id retrieval.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py | Adds folder-related listing/search/pagination test cases to validate folder-scope query behavior. |
| services/web/server/src/simcore_service_webserver/projects/_projects_repository_legacy.py | Rewrites access-rights filtering to EXISTS and introduces folder-scope-specific query strategies. |
| services/storage/tests/unit/test_db_access_layer.py | Adds tests for get_readable_project_ids across private/shared/no-access scenarios. |
| services/storage/src/simcore_service_storage/modules/db/access_layer.py | Replaces join+GROUP BY subquery with EXISTS for readable project ID listing in storage access layer. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #9031 +/- ##
===========================================
- Coverage 87.34% 66.88% -20.47%
===========================================
Files 2056 844 -1212
Lines 80962 39469 -41493
Branches 1451 182 -1269
===========================================
- Hits 70714 26397 -44317
- Misses 9837 13022 +3185
+ Partials 411 50 -361
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
a00f890
into
ITISFoundation:master
…S in get_readable_project_ids (#9031)



What do these changes do?
Optimizes
_list_user_projects_access_rights_with_read_accessin the storage service's access_layer.py by replacing the GROUP BY + jsonb_object_agg subquery JOIN with a simple EXISTS subquery — same pattern applied to the webserver's project listing in #9028.Related issue/s
How to test
Dev-ops