Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
4b7a7060
Commit
4b7a7060
authored
Jan 31, 2018
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos/collect/db.py: Create an index on user table to speed up monitor collect query.
parent
5139881c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
slapos/collect/db.py
slapos/collect/db.py
+4
-0
No files found.
slapos/collect/db.py
View file @
4b7a7060
...
...
@@ -48,6 +48,9 @@ class Database:
" io_cycles_counter real, date text, time text, "
\
" reported integer NULL DEFAULT 0)"
CREATE_USER_PARTITION_DATE_TIME_INDEX
=
"CREATE INDEX user_partition_date_time ON"
\
" user (partition, date, time)"
CREATE_FOLDER_TABLE
=
"create table if not exists folder "
\
"(partition text, disk_used real, date text, "
\
" time text, reported integer NULL DEFAULT 0)"
...
...
@@ -146,6 +149,7 @@ class Database:
assert
self
.
CREATE_USER_TABLE
is
not
None
self
.
connect
()
self
.
_execute
(
self
.
CREATE_USER_TABLE
)
self
.
_execute
(
self
.
CREATE_USER_PARTITION_DATE_TIME_INDEX
)
self
.
_execute
(
self
.
CREATE_FOLDER_TABLE
)
self
.
_execute
(
self
.
CREATE_COMPUTER_TABLE
)
self
.
_execute
(
self
.
CREATE_SYSTEM_TABLE
)
...
...
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