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: select count(*) optimization

Re: select count(*) optimization

From: Joe Rogers <joer_at_renewal-iis.com>
Date: 1997/03/11
Message-ID: <3325CF40.1B47@renewal-iis.com>#1/1

Tell it explicitly to use the index, using a hint:

SELECT /*+ INDEX_ASC(blah PK_BLAH) */

   COUNT(*)
   FROM blah;

> > >Anyone know how to fool the optimizer into using a
> > >primary key access path to count all rows in a table?
> > >e.g.
> > > select count(*) from blah;
> > >
> > >In my case the rows are very long, the prim key is very short,
> > >and the full table scan brings the machine to its knobby knees.
 

-- 
Joe Rogers
Intelligent Information Systems, Inc.
joer_at_renewal-iis.com
Received on Tue Mar 11 1997 - 00:00:00 CST

Original text of this message

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