From: Stephan Schlecht <stephan@software7.de>
Subject: Re: how to speed up a "select count(*) from ..."
Date: 2000/05/05
Message-ID: <3912C427.6228978@software7.de>#1/1
Content-Transfer-Encoding: 7bit
References: <8eu49s$4676$1@stargate1.inet.it>
To: Paolo Polce <java.group@bricabrac.it>
X-Accept-Language: de,en
Content-Type: text/plain; charset=us-ascii
X-Trace: 5 May 2000 08:41:01 -0500, nbgdi6-212-144-156-067.arcor-ip.net
Organization: Software 7 GmbH
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.server


>   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... :-(

You could try to use "select count(1) from mytable",
but I never tried how much faster this is.

Stephan Schlecht
--
Software 7 GmbH
Regensburg          
http://www.software7.de


