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: Need a Fast Row Count

Re: Need a Fast Row Count

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/03/23
Message-ID: <38D9EEC4.2D51@yahoo.com>#1/1

Gary Brumfield wrote:
>
> Is there any other way than "select count(*) from <table>" to return the
> number of rows in an Oracle table? This takes forever to run (>3
> minutes) on a table that has over 3 million rows. I guess it has to do
> a full table scan to determine the correct number of rows and in a read
> consistent manner. It would be OK even if we got a count that was
> fairly close.
>
> Any Ideas or Insight?

You could put a bitmap index on it - the count(*) will then fly along although a whole lot of other things may come into play.

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Thu Mar 23 2000 - 00:00:00 CST

Original text of this message

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