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: Index to speed up "select count(*) from" queries...

Re: Index to speed up "select count(*) from" queries...

From: Torsten Borchert <T.Borchert_at_DeutschePost.de>
Date: Mon, 17 May 1999 14:41:42 +0200
Message-ID: <37400E86.4D4E0681@DeutschePost.de>


Hi,

you can speed up it, when your table has a primery key:

select count(*) from table is the same like select count(primary_key_column) from table (but faster over the index). If you have a query like select coumt(*) from table where col='BLA' ==> make a (bitmap) index on col. Over bitmap indexes you can speed up even queries like 'select count(col) from table where col is null'! Offcourse you need at least Oracle 7.3. ...

tim_mcconechy_at_my-dejanews.com wrote:
>
> My application needs to do some count(*) queries...
>
> Is there some kind of index I can use to speed this query..
>
> On a table with 100000 records it takes a couple seconds longer than I
> would like...
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
Received on Mon May 17 1999 - 07:41:42 CDT

Original text of this message

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