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(*) is very slow

Re: Count(*) is very slow

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Wed, 21 Oct 1998 11:49:47 +0200
Message-ID: <70karf$3md$1@hermes.is.co.za>


Andreas Kyritz wrote in message <70i5pa$siv$1_at_news.ipf.net>...

>Now my database is very well analyzed, but it makes no difference.

Yep. Think it does do a full table scan when a SELECT count(*) is done. An analyze will make no difference at all (excepting of course when using PQ as explained in my previous post).

>Why isn't it possible to use the primary key for computing SELECT count(*)
>FROM ...?
>I think, most dbms doing it in this way.

A SELECT count(*) tells the database engine to count the number of rows in a table. Not the number of index entries. :-)

>Unfortunenably I have only one processor in my server 8-( . Or works PQ
also
>with one processor in 2 and more threads, there are mostly 75% free
>cpu-ressources on the system ?

PQ works on anything from a single CPU box to 32 processor SMP and MPP boxes. Remember there's a difference between PQ (parallel query) and PS (parallel server). PQ means that the db engine runs multiple PQ processes (see max and min parallel processes in init.ora). Simplisticly, if a PQ is idle and Oracle can do something in parallel it will use that PQ to do a portion of the work.

Parallel Server means running multiple db engines (or instances) for the same database SID on different hardware boxes/nodes.

IMO anyone that is seriously using Oracle -must- use PQ. It makes no sense not using PQ.

regards,
Billy Received on Wed Oct 21 1998 - 04:49:47 CDT

Original text of this message

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