Commit 24349147 authored by Leigh Stoller's avatar Leigh Stoller

Add index to apt_instance_history to speed up slow query.

parent 05cdd21e
......@@ -371,7 +371,8 @@ CREATE TABLE `apt_instance_history` (
KEY `profile_id` (`profile_id`),
KEY `creator` (`creator`),
KEY `creator_idx` (`creator_idx`),
KEY `pid_idx` (`pid_idx`)
KEY `pid_idx` (`pid_idx`),
KEY `servername` (`uuid`,`servername`(32))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBKeyExists("apt_instance_history", "servername")) {
DBQueryFatal("ALTER TABLE apt_instance_history " .
"ADD KEY `servername` (`uuid`,`servername`(32))");
}
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
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