Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
cbb94e69
Commit
cbb94e69
authored
Feb 07, 2014
by
Sofia Papagiannaki
Browse files
pithos: Create index on nodes.latest_version
parent
3bfa6241
Changes
3
Hide whitespace changes
Inline
Side-by-side
snf-pithos-backend/pithos/backends/lib/sqlalchemy/alembic/versions/301fba21d9b8_add_nodes_latest_ver.py
0 → 100644
View file @
cbb94e69
"""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'
)
snf-pithos-backend/pithos/backends/lib/sqlalchemy/node.py
View file @
cbb94e69
...
...
@@ -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
=
[]
...
...
snf-pithos-backend/pithos/backends/lib/sqlite/node.py
View file @
cbb94e69
...
...
@@ -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,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment