From: "K. Friday" <kfriday@execpc.com>
Subject: Re: how to speed up a "select count(*) from ..."
Date: 2000/05/05
Message-ID: <3912bb1a$0$63041@news.execpc.com>#1/1
References: <8eu49s$4676$1@stargate1.inet.it>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Complaints-To: abuse@execpc.com
X-Trace: Tl\okXWcmLWI5[332>a9Y[bfNiaEHUgJWRYcgIRLSUE]`2BMGKR<D0PLA<OYmOm81W=CX3hleRV`^9QlYb]kOTdW`Ya>D3S\MhV
Organization: ExecPC Internet - Milwaukee, WI
X-MSMail-Priority: Normal
Newsgroups: comp.databases.oracle.server


Hi,

Does the statement have a "where" clause ? The index will only help if
you're subsetting the table. If what you're doing is a count of all rows in
the table it will do a full table scan (in fact you generally want it to)
regardless of available indexing.

Ken F.
"Paolo Polce" <java.group@bricabrac.it> wrote in message
news:8eu49s$4676$1@stargate1.inet.it...
> Hello,
>
>   I have a table with 40.000 records. There was no primary key on the
 table
> (!) and a "select count(*) from mytable" took about 15 sec.
> So, now, I've created a primary index on mytable.id field...
>
> Well... it still takes 15 sec to count the records... :-(
> May someone help me?
>
> Thank you.
> Paolo.
>
>
>




