Add indexes to revision table
The commit and parent columns were not indexed, meaning that checking to see if a commit's parent needed to be synced incurred a full table scan. Add indexes so it's faster. Change-Id: I093f8265a655a1fe2b7ba1be792b87e6d701fec1
This commit is contained in:
parent
db9b6407b6
commit
461a0eee45
23
gertty/alembic/versions/1cdd4e2e74c_add_revision_indexes.py
Normal file
23
gertty/alembic/versions/1cdd4e2e74c_add_revision_indexes.py
Normal file
@ -0,0 +1,23 @@
|
||||
"""add revision indexes
|
||||
|
||||
Revision ID: 1cdd4e2e74c
|
||||
Revises: 4a802b741d2f
|
||||
Create Date: 2015-03-10 16:17:41.330825
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1cdd4e2e74c'
|
||||
down_revision = '4a802b741d2f'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_index(op.f('ix_revision_commit'), 'revision', ['commit'])
|
||||
op.create_index(op.f('ix_revision_parent'), 'revision', ['parent'])
|
||||
|
||||
|
||||
def downgrade():
|
||||
pass
|
@ -71,8 +71,8 @@ revision_table = Table(
|
||||
Column('change_key', Integer, ForeignKey("change.key"), index=True),
|
||||
Column('number', Integer, index=True, nullable=False),
|
||||
Column('message', Text, nullable=False),
|
||||
Column('commit', String(255), nullable=False),
|
||||
Column('parent', String(255), nullable=False),
|
||||
Column('commit', String(255), index=True, nullable=False),
|
||||
Column('parent', String(255), index=True, nullable=False),
|
||||
Column('fetch_auth', Boolean, nullable=False),
|
||||
Column('fetch_ref', String(255), nullable=False),
|
||||
Column('pending_message', Boolean, index=True, nullable=False),
|
||||
|
Loading…
Reference in New Issue
Block a user