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

Add index on task run names for global search #149

Merged
merged 2 commits into from
Dec 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Add index for task run names

Revision ID: 57ac2cb01ac1
Revises: 3c87ad7e0b71
Create Date: 2020-12-02 13:09:56.377051

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import JSONB, UUID


# revision identifiers, used by Alembic.
revision = "57ac2cb01ac1"
down_revision = "3c87ad7e0b71"
branch_labels = None
depends_on = None


def upgrade():
op.execute(
"""
CREATE INDEX
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jlowin Do we do concurrent index creation in Server .. ?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's necessary here

ix_task_run_name_trgm
ON task_run USING GIN (name gin_trgm_ops)
WHERE name IS NOT NULL
"""
)


def downgrade():
op.drop_index("ix_task_run_name_trgm", table_name="task_run")