On 19 Feb 2007 16:59:46 -0800,
christopher@dailycrossword.com wrote:
> Thanx peter --
> I am trying to optimize too early, I think.. I can forsee several
> instances where the table will contain unreferenced data -- for
> example if something is inadvertantly deleted. If I delete the
> eintire tree and the user did not intend that (even after
> confirmation) that would be bad. OTOH if I leave the unreferenced
> data in the table for a manual rebuild, then it clutters up these
> fancy joins I am trying to devise.
This is the thing for which constraints were invented. They'll prevent
orphaned items and the like, by either cascading deletes of parent items
(and deleting all the dependant child items) or restricting deletes of
items with dependants from happening in the first place.
http://dev.mysql.com/doc/refman/5.0/...nstraints.html
> Better if I go with my first solution and walk through the table with
> the software -- probably take 0.08 secs or something.
Read the page above and mull it for a day or two. You might change your
mind back again.
--
93. If I decide to hold a double execution of the hero and an underling who
failed or betrayed me, I will see to it that the hero is scheduled to go
first.
--Peter Anspach's list of things to do as an Evil Overlord