In response to Marc Schiffbauer <[EMAIL PROTECTED]>: > * Dan Langille schrieb am 09.09.08 um 22:15 Uhr: > > Marc Schiffbauer wrote: > > > * Bill Moran schrieb am 09.09.08 um 19:41 Uhr: > > >> The canonical way to solve this would be to keep a reference counter in > > >> the filename/path tables that keeps track of how many file entries > > >> reference that row. When it's hits 0, it can be deleted. But this > > >> creates other issues: > > >> 1) What is the overhead of maintaining the reference counter? > > >> 2) In the case of a crash, we _must_ fix all reference counters > > >> immediately, > > >> otherwise records could be deleted that still need to be used. > > >> > > >> Referential integrity doesn't even gain us much here, as that only > > >> guarantees that records can't be created that don't have proper > > >> references, it doesn't automatically clean up after deletes. > > > > > > AFAIK it does work if the database is properly created, not? > > > (with foreign keys) > > > > What are you talking about? :) Please elaborate. > > I was talking about constraints that let the database delete records > that would otherwise be "orphaned" records. > > -> "ON DELETE CASCADE" > > Would this be to much of a performance impact? > > Or did I not get the point? :)
1) Not supported by all platforms that Bacula supports (unless the project has already dropped support for slightly older MySQL versions?) 2) Doesn't solve the problem anyway. CASCADE will delete child records (file) when parent records (filename) are deleted. The orphan problem is the reverse and no SQL engine I'm aware of does that because it requires exactly the sort of reference counting overhead that I described earlier. -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ [EMAIL PROTECTED] Phone: 412-422-3463x4023 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Bacula-devel mailing list Bacula-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-devel