Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: counting rows

Re: counting rows

From: paul c <toledobythesea_at_oohay.ac>
Date: Fri, 31 Mar 2006 00:56:45 GMT
Message-ID: <h7%Wf.201992$sa3.129417@pd7tw1no>


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.

pc Received on Thu Mar 30 2006 - 18:56:45 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US