On 03/07/06, Troels Arvin <troels@xxxxxxxx> wrote:
Hello,
I'm writing a patch which adds PostgreSQL support to ViewVC. Unlike the
patch in Issue 133, I plan to keep MySQL support. I'm also implementing
schema support (only relevant for PostgreSQL, but doesn't break MySQL).
One thing which puzzles me is the "descs" table, especially in connection
with UPDATEs. It seems that a commit message may be shared by several
checkins. This is problem if a log message is changed for a specific
commit. And, by the way, svndbadmin doesn't update log messages as it is,
as far as I can see.
Another thing: The "descs" table has a "hash" column. Am I right in
assuming that it exists for some kind of performance optimization?
Why keep log messages (commit descriptions) in a separate table anyway? I
suggest that the commit messsages be part of the "checkins" table, in a
new column of type "text". I don't know if the hash column makes sense to
keep.
Remember that the checkin db schema originated with bonsai, which was
designed to work with CVS repositories.
As CVS doesn't have tree-wide commits, rows in the "checkins" table
refer to a change to a particular file. If the log message was in the
checkins table, it would be repeated for each file
added/removed/changed in the commit. So the checkins table uses a
foreign key into the descs table to store the log message.
This still makes sense when using viewvc for a Subversion repository,
since you'll still have multiple rows in the checkins table for each
commit (one for each modified file).
The "hash" column in the descs is used to speed up checks to see if a
log message has been used before, to save on storage further (note
however that the hash algorithm used sucks, but is compatible with
what Bonsai uses). Note also that the data in the descs column is
never actually modified -- if a log message is changed, a new descs
row is created rather than modifying the old one (effectively giving
you copy on write).
There are changes that could improve data normalisation for storing
Subversion commit info, but moving the log message to the checkins
table is not one of them.
James.
|
|