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

Home -> Community -> Usenet -> c.d.o.server -> Re: COUNT(*) takes forever

Re: COUNT(*) takes forever

From: Johnny Verhoeven <johnny_at_pentasystems.com>
Date: Thu, 04 Feb 1999 23:18:41 +0100
Message-ID: <36BA1CC1.1F88@pentasystems.com>


Richard Murphy wrote:
>
> Anyone now what would cause a simple select count(*) to take a very long
> time (hours) on a table of 26 million rows. Other processes on the
> database do not seem to be a problem. This is on Oracle 8 on VMS.
>
> Thanks, R.

Count (*) does a full tablescan. If you have a unique index on the table try count(fieldname) that does an index scan and is usualy much faster

Johnny Verhoeven
Pentasystems
e-commerce software
http://www.pentasystems.com Received on Thu Feb 04 1999 - 16:18:41 CST

Original text of this message

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