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

feat(db): index tables to improve study search and sorting performance #1902

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

laurent-laporte-pro
Copy link
Contributor

Goal

This pull request aims to enhance the performance of search and sorting operations in the
study, rawstudy, and study_additional_data tables by adding indexes to frequently used columns.

Changes Made

  • Modified models in the antarest.study.model module to include the indexes.
  • Added a new migration file in the alembic/versions directory.
  • Added a unit test to verify that the indexes have been successfully added.
  • Updated the script/rollback.sh script to accommodate the new migration.

Indexed Columns:

  • rawstudy: Index on the workspace column.
  • study: Index on the
    archived, created_at, folder, name, owner_id, parent_id, type, updated_at, and version columns.
  • study_additional_data: Index on the patch column.

Migration Testing

The upgrade and downgrade of the migration have been successfully tested on both PostgreSQL
and SQLite databases locally.

No noticeable slowdown has been observed during the migration on a test database.

@laurent-laporte-pro laurent-laporte-pro added enhancement New feature or request feature request performance Improvement of performance (database and filesystem access) labels Jan 19, 2024
@laurent-laporte-pro laurent-laporte-pro added this to the v2.16.4 milestone Jan 19, 2024
@laurent-laporte-pro laurent-laporte-pro self-assigned this Jan 19, 2024
The goal of this migration is to add indexes on the `study`, `rawstudy` and `study_additional_data` tables, in order to speed up data search queries for the search engine.
@mabw-rte mabw-rte force-pushed the feature/1035-index-study-table-search-engine branch from 2b18e61 to 447353a Compare January 23, 2024 13:09
@laurent-laporte-pro laurent-laporte-pro merged commit 4ef1f38 into dev Jan 23, 2024
6 checks passed
@laurent-laporte-pro laurent-laporte-pro deleted the feature/1035-index-study-table-search-engine branch January 23, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request performance Improvement of performance (database and filesystem access) size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants