Re: [viewvc-dev] Bug in purge in db admin scripts
"Larry Shatzer, Jr." <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jul 1, 2008 at 12:36 PM, C. Michael Pilato <[email protected]> wrote: > > Larry, I'm *really glad* you brought this up. I recently ran into the > side-effects of this problem, and was rather confused at those symptoms. I > half-suspected that what you describe here was the ultimate source of the > problems, but never got around to checking it out. > Yeah, this had been bugging me why I was getting random stack traces from queries, and a "rebuild" of the commit database fixed it. I was moving stuff from our old CVS repositories into an "Archive" one, and running the rebuild caused a purge of the data. A patch from you with resolves this would be *most* welcome. > I hope to have an initial patch for this soon. I might have some questions concerning parts of best how to approach this. (See below for alternate idea). > > Question: would adding these additional indexes cause problems for folks > using ViewVC commits databases with Bonsai? (The schemas were designed to > match each other.) > I don't know if an index would interfere with the day to day operations of either. For people who did not use our create table scripts (or run another script to apply any custom indexes) they would notice a slow down on the purge option. Of course any indexes that could be useful should be shared back with the Bonsai people. While thinking about it, the delete statements that are currently run could be modified to also query the checkins table to make sure it is not going to orphan rows with a where clause. Such as DELETE FROM files WHERE id = 'ID' AND id NOT IN (SELECT ID FROM checkins WHERE fileid = 'ID'), etc. And yes, I'll create a ticket to track this. :) -- Larry