Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
4c147b21
Commit
4c147b21
authored
Sep 02, 2011
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index and use "force index" in query; drops "more entries" time
from 20 seconds to under 1.
parent
e8bb25b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
sql/database-create.sql
sql/database-create.sql
+2
-1
sql/updates/4/260
sql/updates/4/260
+18
-0
www/showstats.php3
www/showstats.php3
+1
-1
No files found.
sql/database-create.sql
View file @
4c147b21
...
@@ -3681,7 +3681,8 @@ CREATE TABLE `testbed_stats` (
...
@@ -3681,7 +3681,8 @@ CREATE TABLE `testbed_stats` (
KEY
`rsrcidx`
(
`rsrcidx`
),
KEY
`rsrcidx`
(
`rsrcidx`
),
KEY
`exptidx`
(
`exptidx`
),
KEY
`exptidx`
(
`exptidx`
),
KEY
`uid_idx`
(
`uid_idx`
),
KEY
`uid_idx`
(
`uid_idx`
),
KEY
`idxdate`
(
`end_time`
,
`idx`
)
KEY
`idxdate`
(
`end_time`
,
`idx`
),
KEY
`end_time`
(
`end_time`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
--
--
...
...
sql/updates/4/260
0 → 100644
View file @
4c147b21
#
# Add key to testbed_stats
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBKeyExists("testbed_stats", "end_time")) {
DBQueryFatal("ALTER TABLE testbed_stats " .
"ADD KEY `end_time` (`end_time`)");
}
return 0;
}
1;
www/showstats.php3
View file @
4c147b21
...
@@ -194,7 +194,7 @@ $query_result =
...
@@ -194,7 +194,7 @@ $query_result =
DBQueryFatal
(
"select t.exptidx,s.pid,s.eid,t.action,t.exitcode,t.uid, "
.
DBQueryFatal
(
"select t.exptidx,s.pid,s.eid,t.action,t.exitcode,t.uid, "
.
" r.pnodes,t.idx as statno,t.start_time,t.end_time, "
.
" r.pnodes,t.idx as statno,t.start_time,t.end_time, "
.
" s.archive_idx,r.archive_tag,t.uid_idx "
.
" s.archive_idx,r.archive_tag,t.uid_idx "
.
" from testbed_stats as t "
.
" from testbed_stats as t
force index (end_time, idx)
"
.
"left join experiment_stats as s on s.exptidx=t.exptidx "
.
"left join experiment_stats as s on s.exptidx=t.exptidx "
.
"left join experiment_resources as r on r.idx=t.rsrcidx "
.
"left join experiment_resources as r on r.idx=t.rsrcidx "
.
"
$wclause
"
.
"
$wclause
"
.
...
...
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