Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: What to Count - WAS Re: Newbie ? - Howto find nbr records in a table
So, the meaning of * changes depending on what you;re doing then?
SELECT * FROM table will return values for all columns
COUNT(*) is a special syntax which is optimised internally to do the best count. No data is retrieved from the record by use of * here? This is what started this thread. I assumed COUNT(*) will extract data from the record once found whereas COUNT(9) would simply have to find the record.
--
Alan D. Mills
hartleym_at_netcomuk.co.uk wrote in message
<361fe2f9.15818043_at_nntp.netcomuk.co.uk>...
>
>select count(*) from table;
>
>this is best, it allows the oracle optimizer to chose the most
>selective index, and hence reduce any I/O as necessary.
>
>What the internal logic counts is irrelevant, why count rowid, when
>all that is needed is to increment a counter each time the search
>condition is true.
Received on Mon Oct 12 1998 - 03:58:16 CDT