mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
perf: add index to tweak our default search query
Adds an index on PackageBases.Popularity and PackageBases.Name to improve performance of our default search query sorted by "Popularity" Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
parent
c41f2e854a
commit
7c8b9ba6bc
1 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
"""Add index on PackageBases.Popularity and .Name
|
||||
|
||||
Revision ID: c5a6a9b661a0
|
||||
Revises: e4e49ffce091
|
||||
Create Date: 2023-07-02 13:46:52.522146
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "c5a6a9b661a0"
|
||||
down_revision = "e4e49ffce091"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_index(
|
||||
"BasesPopularityName", "PackageBases", ["Popularity", "Name"], unique=False
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_index("BasesPopularityName", table_name="PackageBases")
|
Loading…
Add table
Reference in a new issue