Re: counting rows

From: David Cressey <>
Date: Fri, 31 Mar 2006 11:19:55 GMT
Message-ID: <vf8Xf.1709$Se.730_at_trndny01>

"paul c" <> wrote in message news:h7%Wf.201992$sa3.129417_at_pd7tw1no...
> wrote:
> > Consider the tables USERS and PICTURES. When retrieving the number of
> > pictures from a user there are two ways:
> >
> > 1) I count them from pictures table.
> > 2) I pick it directly from a field "numPictures" in table users.
> >
> > How are you used to do this? Which is better?
> > Thanks
> >
> In a way, it's like the riddles about changing light bulbs (the one I
> like best is 'how many psychiatrists?' - answer 'only one but the light
> bulb has to want to change'). When even mainframes took a second or two
> to count to a million it seemed the fastest way to do that was store
> (pardon me, I should have said 'memorize') the number in the database.
> I think it depends on what the number means to you and what if anything
> its production means to you. I don't believe that any DB dogma has
> anything useful in the sense of right or wrong to say about this.
> pc

My favorite is "how many Zen Buddhists does it take to change a light bulb?

Two: one to change the light bulb, and the other to NOT change the light bulb. Received on Fri Mar 31 2006 - 13:19:55 CEST

Original text of this message