-
Notifications
You must be signed in to change notification settings - Fork 32
β»οΈπ¨ Improve DB query listing_projects performance (ποΈ)
#7475
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
Merged
matusdrobuliak66
merged 15 commits into
ITISFoundation:master
from
matusdrobuliak66:improve-sql-listing-projects
Apr 4, 2025
Merged
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8c2ff95
improve query performance
matusdrobuliak66 8c20f5c
Merge branch 'master' into improve-sql-listing-projects
matusdrobuliak66 0e8329b
improve query performance
matusdrobuliak66 1b22a2b
improve query performance
matusdrobuliak66 2865426
improve query performance
matusdrobuliak66 58fb915
review @pcrespov
matusdrobuliak66 c3e8c94
Merge branch 'master' into improve-sql-listing-projects
matusdrobuliak66 9257d45
fix
matusdrobuliak66 ced50cf
fix test
matusdrobuliak66 3e0848d
fix test
matusdrobuliak66 71a807d
modify index
matusdrobuliak66 3f99c18
modify listing of projects also in the storage service
matusdrobuliak66 10cc6cb
modify listing of projects also in the storage service
matusdrobuliak66 65fa890
fix
matusdrobuliak66 3af0640
fix
matusdrobuliak66 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
...res-database/src/simcore_postgres_database/migration/versions/aa2c85e8a66a_add_indexes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| """add indexes | ||
|
|
||
| Revision ID: aa2c85e8a66a | ||
| Revises: 48604dfdc5f4 | ||
| Create Date: 2025-04-03 15:45:02.586547+00:00 | ||
|
|
||
| """ | ||
|
|
||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "aa2c85e8a66a" | ||
| down_revision = "48604dfdc5f4" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.create_index( | ||
| "idx_project_to_groups_gid", "project_to_groups", ["gid"], unique=False | ||
| ) | ||
| op.create_index( | ||
| "idx_projects_last_change_date_desc", | ||
| "projects", | ||
| ["last_change_date"], | ||
| unique=False, | ||
| postgresql_using="btree", | ||
| postgresql_ops={"last_change_date": "DESC"}, | ||
matusdrobuliak66 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
| op.create_index("idx_projects_type", "projects", ["type"], unique=False) | ||
| op.create_index( | ||
| "idx_project_to_folders_project_uuid", | ||
| "projects_to_folders", | ||
| ["project_uuid"], | ||
| unique=False, | ||
| ) | ||
| op.create_index( | ||
| "idx_project_to_folders_user_id", | ||
| "projects_to_folders", | ||
| ["user_id"], | ||
| unique=False, | ||
| ) | ||
| op.create_index( | ||
| "idx_projects_to_products_product_name", | ||
| "projects_to_products", | ||
| ["product_name"], | ||
| unique=False, | ||
| ) | ||
| op.create_index( | ||
| "idx_workspaces_access_rights_gid", | ||
| "workspaces_access_rights", | ||
| ["gid"], | ||
| unique=False, | ||
| ) | ||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.drop_index( | ||
| "idx_workspaces_access_rights_gid", table_name="workspaces_access_rights" | ||
| ) | ||
| op.drop_index( | ||
| "idx_projects_to_products_product_name", table_name="projects_to_products" | ||
| ) | ||
| op.drop_index("idx_project_to_folders_user_id", table_name="projects_to_folders") | ||
| op.drop_index( | ||
| "idx_project_to_folders_project_uuid", table_name="projects_to_folders" | ||
| ) | ||
| op.drop_index("idx_projects_type", table_name="projects") | ||
| op.drop_index( | ||
| "idx_projects_last_change_date_desc", | ||
| table_name="projects", | ||
| postgresql_using="btree", | ||
| postgresql_ops={"last_change_date": "DESC"}, | ||
| ) | ||
| op.drop_index("idx_project_to_groups_gid", table_name="project_to_groups") | ||
| # ### end Alembic commands ### | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.