Skip to content

Commit

Permalink
Add index on the query table on the result key column
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Kyryliuk committed Jan 24, 2017
1 parent 6e5eed8 commit a7ff828
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Add index on the result key to the query table.
Revision ID: f18570e03440
Revises: 1296d28ec131
Create Date: 2017-01-24 12:40:42.494787
"""
from alembic import op

# revision identifiers, used by Alembic.
revision = 'f18570e03440'
down_revision = '1296d28ec131'


def upgrade():
op.create_index(op.f('ix_query_results_key'), 'query', ['results_key'], unique=False)


def downgrade():
op.drop_index(op.f('ix_query_results_key'), table_name='query')
2 changes: 1 addition & 1 deletion superset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@ class Query(Model):
rows = Column(Integer)
error_message = Column(Text)
# key used to store the results in the results backend
results_key = Column(String(64))
results_key = Column(String(64), index=True)

# Using Numeric in place of DateTime for sub-second precision
# stored as seconds since epoch, allowing for milliseconds
Expand Down

0 comments on commit a7ff828

Please sign in to comment.