Skip to content

Commit

Permalink
Adding index to speed zombie lokkup
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 21, 2015
1 parent 473c777 commit 3306eb5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions airflow/migrations/versions/52d714495f0_job_id_indices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""job_id indices
Revision ID: 52d714495f0
Revises: 338e90f54d61
Create Date: 2015-10-20 03:17:01.962542
"""

# revision identifiers, used by Alembic.
revision = '52d714495f0'
down_revision = '338e90f54d61'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql


def upgrade():
op.create_index('idx_job_state_heartbeat', 'job', ['state', 'latest_heartbeat'], unique=False)


def downgrade():
op.drop_index('idx_job_state_heartbeat', table_name='job')

0 comments on commit 3306eb5

Please sign in to comment.