| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: counting rows
Number 2 will be best because you are effectively storing the aggregate
instead of the server having to count the number of rows in the table which
would require IO.
Tony.
-- Tony Rogerson SQL Server MVP http://sqlserverfaq.com - free video tutorials <bucaliman_at_gmail.com> wrote in message news:1143753100.408985.38260_at_u72g2000cwu.googlegroups.com...Received on Fri Mar 31 2006 - 01:46:20 CST
> 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
>
![]() |
![]() |