aboutsummaryrefslogtreecommitdiffstats
path: root/git-cvsserver.perl
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2006-10-23 01:09:35 -0400
committerJunio C Hamano <junkio@cox.net>2006-10-22 23:06:00 -0700
commit178e015c0543b581a40adbf4822f44fa592ff68b (patch)
tree013e56dd790038307605523514f4492b135928d1 /git-cvsserver.perl
parentb6b7fc7283bd091822541c0286340e78b0c497a2 (diff)
downloadgit-178e015c0543b581a40adbf4822f44fa592ff68b.tar.gz
Use column indexes in git-cvsserver where necessary.
Tonight I found a git-cvsserver instance spending a lot of time in disk IO while trying to process operations against a Git repository with >30,000 objects contained in it. Blowing away my SQLLite database and rebuilding all tables with indexes on the attributes that git-cvsserver frequently runs queries against seems to have resolved the issue quite nicely. Since the indexes shouldn't hurt performance on small repositories and always helps on larger repositories we should just always create them when creating the revision storage tables. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-xgit-cvsserver.perl14
1 files changed, 13 insertions, 1 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 08ad831a39..8817f8bb4f 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -2118,9 +2118,17 @@ sub new
mode TEXT NOT NULL
)
");
+ $self->{dbh}->do("
+ CREATE INDEX revision_ix1
+ ON revision (name,revision)
+ ");
+ $self->{dbh}->do("
+ CREATE INDEX revision_ix2
+ ON revision (name,commithash)
+ ");
}
- # Construct the revision table if required
+ # Construct the head table if required
unless ( $self->{tables}{head} )
{
$self->{dbh}->do("
@@ -2134,6 +2142,10 @@ sub new
mode TEXT NOT NULL
)
");
+ $self->{dbh}->do("
+ CREATE INDEX head_ix1
+ ON head (name)
+ ");
}
# Construct the properties table if required