Re: counting rows
Date: Fri, 31 Mar 2006 11:19:55 GMT
"paul c" <toledobythesea_at_oohay.ac> wrote in message
> bucaliman_at_gmail.com 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.
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