Skip to content

Commit

Permalink
Use column indexes in git-cvsserver where necessary.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn Pearce authored and Junio C Hamano committed Oct 23, 2006
1 parent b6b7fc7 commit 178e015
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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("
Expand All @@ -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
Expand Down

0 comments on commit 178e015

Please sign in to comment.