Skip to content

Conversation

@matusdrobuliak66
Copy link
Collaborator

@matusdrobuliak66 matusdrobuliak66 commented May 22, 2025

What do these changes do?

  • ♻️ Improve/Speedup project listing
    • Removed a long subquery/join in the SQL query used to compute project access rights. The Postgres engine sometimes fails to evaluate the computation optimally, causing the subquery to be executed multiple times for each project. By simplifying the query and executing a second query to retrieve access rights only for the already prepagated projects, we significantly improve the performance of project listing for users with many projects.
    • @bisgaard-itis This should be tested in the in-house master branch using your account. (Your case was the trigger for this investigation.) 🚨
    • ⚠️ One more action is required: we should set statement_timeout = '120s'. If a query exceeds this time limit, PostgreSQL will automatically terminate it and return an error. This is the recommended approach to prevent runaway queries from consuming resources indefinitely.

Related issue/s

How to test

Dev-ops

@matusdrobuliak66 matusdrobuliak66 self-assigned this May 22, 2025
@codecov
Copy link

codecov bot commented Jun 1, 2025

Codecov Report

Attention: Patch coverage is 73.33333% with 12 lines in your changes missing coverage. Please review.

Project coverage is 82.54%. Comparing base (cc3dbbe) to head (9087517).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7737      +/-   ##
==========================================
- Coverage   86.74%   82.54%   -4.20%     
==========================================
  Files        1850      703    -1147     
  Lines       71802    33541   -38261     
  Branches     1215      176    -1039     
==========================================
- Hits        62283    27688   -34595     
+ Misses       9178     5795    -3383     
+ Partials      341       58     -283     
Flag Coverage Δ
integrationtests 64.19% <28.88%> (-0.06%) ⬇️
unittests 86.77% <73.33%> (+0.27%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 77.07% <ø> (-8.02%) ⬇️
agent ∅ <ø> (∅)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director ∅ <ø> (∅)
director_v2 77.69% <ø> (-13.35%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 88.34% <ø> (-1.74%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations ∅ <ø> (∅)
payments ∅ <ø> (∅)
resource_usage_tracker ∅ <ø> (∅)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 83.70% <73.33%> (-0.09%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc3dbbe...9087517. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@matusdrobuliak66 matusdrobuliak66 changed the title WIP: speedup project listing ♻️ speedup project listing 🚨 Jun 1, 2025
@matusdrobuliak66 matusdrobuliak66 marked this pull request as ready for review June 1, 2025 10:55
@matusdrobuliak66 matusdrobuliak66 enabled auto-merge (squash) June 1, 2025 10:55
@matusdrobuliak66 matusdrobuliak66 added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Jun 1, 2025
@matusdrobuliak66 matusdrobuliak66 added this to the Bazinga! milestone Jun 1, 2025
Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the quick fix. Please consider my suggestions. I am also happy to discuss.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 2, 2025

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

🚀

@matusdrobuliak66 matusdrobuliak66 merged commit 256fc62 into ITISFoundation:master Jun 2, 2025
91 of 95 checks passed
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

very nice! thanks

@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:webserver webserver's codebase. Assigning the area is particularly useful for bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants