Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> What to Count - WAS Re: Newbie ? - Howto find nbr records in a table
This raises a question for me. The use of COUNT(*) that is. A few years
ago, in my early days of Oracle, a chap with more experience than I
explained that he always used COUNT(9) as opposed to COUNT(*) when doing
this sort of thing. Obviously, it makes absolutley no difference to the
answer. Let's face it, it doesn't matter what you count, the value for each
record is still one as we'd like.
This chap explained is odd use of COUNT(9) away by explaining that using * will retrieve all data from each record, just as with SELECT *, you get all columns back. Using COUNT(9) you only have to locate the record and not extract anything from it so it should be supposedly a little quicker. It makes a sort of logical sense and I do use COUNT(9) sometimes. Is there actually any foundation to this argument though? I've certainly never been able to prove it with any timings. Maybe it simply comes down to whatever is easiest tp type for individuals?
Comments?
--
Alan D. Mills
Jason Jay Weiland wrote in message
<361A6526.3B04961F_at_uclink4.berkeley.edu>...
>Brian,
>
>Try this:
>
>SELECT COUNT(*) FROM FOO;
>
>...where FOO is the table name.
>
Received on Wed Oct 07 1998 - 03:17:00 CDT