Commit cbb94e69 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

pithos: Create index on nodes.latest_version

parent 3bfa6241
"""add nodes latest_version index
Revision ID: 301fba21d9b8
Revises: 54dbdde2d187
Create Date: 2014-02-07 13:39:10.221706
"""
# revision identifiers, used by Alembic.
revision = '301fba21d9b8'
down_revision = '54dbdde2d187'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_index('idx_latest_version', 'nodes',
['latest_version'])
def downgrade():
op.drop_index('idx_latest_version', 'nodes')
......@@ -122,6 +122,7 @@ def create_tables(engine):
nodes = Table('nodes', metadata, *columns, mysql_engine='InnoDB')
Index('idx_nodes_path', nodes.c.path, unique=True)
Index('idx_nodes_parent', nodes.c.parent)
Index('idx_latest_version', nodes.c.latest_version)
#create policy table
columns = []
......
......@@ -128,6 +128,8 @@ class Node(DBWorker):
on nodes(path) """)
execute(""" create index if not exists idx_nodes_parent
on nodes(parent) """)
execute(""" create index if not exists idx_latest_version
on nodes(latest_version) """)
execute(""" create table if not exists policy
( node integer,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment