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

Home -> Community -> Usenet -> c.d.o.misc -> Re: What to Count - WAS Re: Newbie ? - Howto find nbr records in a table

Re: What to Count - WAS Re: Newbie ? - Howto find nbr records in a table

From: Alan D. Mills <alanmNOSPAM_at_uk.europe.mcd.mot.com>
Date: Mon, 12 Oct 1998 09:58:16 +0100
Message-ID: <6vsga3$hqn$1@schbbs.mot.com>


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

Original text of this message

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