View Single Post

   
  #8 (permalink)  
Old 02-28-2008, 09:14 AM
christopher@dailycrossword.com
 
Posts: n/a
Default Re: replacing a programming loop with the correct JOIN

wow -- hou have been amazingly helpful -- thanx
I told my new boss this project requires a database expert from the
get-go, but he wants me to do it all. I have a dozen notes in my code
(there *must* be a better way to do this). I know we will be so far
into this project before we hire an expert that she / he will just
shake her / his head in disbelief and double her / his fee *grin*.
For now I am going to have to take the simplist 'kluge' solution and
hope for the best.

Are you available to consult if he changes his mind?

-- clh

On Feb 19, 5:43 pm, "Peter H. Coffin" <hell...@ninehells.com> wrote:
> On 19 Feb 2007 16:59:46 -0800, christop...@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/...ey-constraints...
>
> > 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



Reply With Quote