Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: Bulk delete

Quote Reply
Re: Bulk delete In reply to
Yes and no. It's not something alex is specifically doing, but he's been adding more features to the table repair -- ie: orphan and widow catching, so if you did a bulk SQL delete as I indicated, then did a "repair" the program would remove the unused CatLink records since they are missing the "link" they are pointing to.

A CatLink record holds two integers:

CategoryID:LinkID

If you remove the Link record that has the LinkID as the ID number, then the record in the CatLink table will not point to anything.

On small to medium sized databases you could probably do something like:

DELETE FROM CatLinks
WHERE LinkID NOT IN (SELECT ID FROM Links)

Without too much of a performance hit. "IN" is available in Mysql 3.21+

_NEVER_ try DELETE statements out!! Always change the DELETE to a SELECT * until the Query returns the values you want, _THEN_ and _ONLY_THEN_ try the DELETE !!! You can't recover from a DELETE... so use it only when you know the query works the way you want!



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Subject Author Views Date
Thread Bulk delete Sir Up 2251 Feb 26, 2001, 1:15 PM
Thread Re: Bulk delete
pugdog 2169 Feb 26, 2001, 1:23 PM
Thread Re: Bulk delete
Sir Up 2151 Feb 26, 2001, 1:28 PM
Post Re: Bulk delete
pugdog 2159 Feb 26, 2001, 1:38 PM
Post Re: Bulk delete
Stealth 2168 Feb 26, 2001, 2:27 PM