提交 178e015c 编写于 作者: S Shawn Pearce 提交者: Junio C Hamano

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: NShawn O. Pearce <spearce@spearce.org>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 b6b7fc72
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册