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
Alan D. Mills wrote:
> If you go back over this thread there was a posting (I foget the persons
> name - sorry) explaining that count(*) is better than count('constant') but
> count(an_index_not_null_field) is faster again.
>
> I've never personally noticed any noticable difference in my work no matter
> which method I've chosen though.
>
> I'll pay closer attention though, in the future.
>
> --
> Alan D. Mills
>
> Uwe Staimann wrote in message
> <3625864f.1012856_at_news.informatik.uni-rostock.de>...
> >On Mon, 12 Oct 1998 09:58:16 +0100, "Alan D. Mills"
> ><alanmNOSPAM_at_uk.europe.mcd.mot.com> wrote:
> >
> >Seriously guys, what is faster? Count(*) or
> >count(an_index_not_null_field) ?
> >We have an ongoing argument in the company and nobody seems
> >to knows it for sure.
> >
Mungo :-)
The command COUNT() evaluate than the fields that you pass as parameter IS NULL
when you do COUNT(*) evaluate all columns, if you use a column indexed and NOT
NULL
the evaluation is much faster, amy be that in tables with few records the
effect is not significant
but when have many, many records.....
Leonel Sanhueza J.
Universidad de Concepcion
lsanhuez_at_udec.cl
Received on Thu Oct 15 1998 - 10:34:58 CDT