-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create index on download/data object association
This should speed up biosample search, since it returns download statistics for each data object for each biosample.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
nmdc_server/migrations/versions/2ec2d0b4f840_create_data_object_id_idx.py
This file contains 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,35 @@ | ||
"""Create index on column `data_object_id` for table `bulk_download_data_object` | ||
Revision ID: 2ec2d0b4f840 | ||
Revises: 5fb9910ca8e6 | ||
Create Date: 2024-10-10 16:48:37.051479 | ||
""" | ||
|
||
from typing import Optional | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "2ec2d0b4f840" | ||
down_revision: Optional[str] = "5fb9910ca8e6" | ||
branch_labels: Optional[str] = None | ||
depends_on: Optional[str] = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_index( | ||
"bulk_download_data_object_id_idx", | ||
"bulk_download_data_object", | ||
["data_object_id"], | ||
unique=False, | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index("bulk_download_data_object_id_idx", table_name="bulk_download_data_object") | ||
# ### end Alembic commands ### |
This file contains 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