* [PATCH] Use column indexes in git-cvsserver where necessary.
@ 2006-10-23 5:09 Shawn Pearce
2006-10-23 6:02 ` Martin Langhoff (CatalystIT)
0 siblings, 1 reply; 2+ messages in thread
From: Shawn Pearce @ 2006-10-23 5:09 UTC (permalink / raw)
To: martyn, martin, Junio C Hamano; +Cc: git
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>
---
git-cvsserver.perl | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 08ad831..8817f8b 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
--
1.4.3.g4e51
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Use column indexes in git-cvsserver where necessary.
2006-10-23 5:09 [PATCH] Use column indexes in git-cvsserver where necessary Shawn Pearce
@ 2006-10-23 6:02 ` Martin Langhoff (CatalystIT)
0 siblings, 0 replies; 2+ messages in thread
From: Martin Langhoff (CatalystIT) @ 2006-10-23 6:02 UTC (permalink / raw)
To: Shawn Pearce; +Cc: martyn, Junio C Hamano, git
Shawn Pearce wrote:
> 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>
Ack.
I am thinking we need a lightweight schema versioning mechanism to
decide whether the DB schema needs changes such as this. Too much work
for this though. ;-)
We have a simple one in Moodle I could port when the time comes.
cheers,
martin
--
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224 MOB: +64(21)364-017
Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-23 6:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 5:09 [PATCH] Use column indexes in git-cvsserver where necessary Shawn Pearce
2006-10-23 6:02 ` Martin Langhoff (CatalystIT)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).