-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(tf): index by the test run group ID
Based on the Sentry's backend insights, it appears that in the last 90d we have spent 16.82min running the query that filters out rows based on the «test run group id», therefore index that column to improve the speed of the queries done. Signed-off-by: Matej Focko <[email protected]>
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
alembic/versions/e3cfec8ce0f7_index_tft_test_run_group_id.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,30 @@ | ||
"""Index tft_test_run_group_id | ||
Revision ID: e3cfec8ce0f7 | ||
Revises: d625d6c1122f | ||
Create Date: 2025-01-17 16:06:29.833622 | ||
""" | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "e3cfec8ce0f7" | ||
down_revision = "d625d6c1122f" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_index( | ||
op.f("ix_tft_test_run_targets_tft_test_run_group_id"), | ||
"tft_test_run_targets", | ||
["tft_test_run_group_id"], | ||
unique=False, | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_index( | ||
op.f("ix_tft_test_run_targets_tft_test_run_group_id"), table_name="tft_test_run_targets" | ||
) |
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