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(*) v. count(pk)

Re: count(*) v. count(pk)

From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: Sun, 03 May 1998 19:58:53 GMT
Message-ID: <354ccbb7.38891484@www.sigov.si>


On Thu, 30 Apr 1998 22:20:52 GMT, "C. Mason" <cmason_at_aai.arco.com> wrote:

>As a matter of fact, the table occupies1265649 data blocks with a block fill
>rate of 98%.
>On the other hand, the BITMAP index used by the select count(*) occupies 932
>blocks.
>Maybe you should refrain from stating the obvious until you have all the
>facts.

I'm a little confused by your "facts". First of all, I don't know if you are the same person as bialik_at_wis.weizmann.ac.il or if you have a direct access to his/her database, but I am quite positive your numbers don't have anything in common whatsoever with the table and index involved in the presented outputs from TKPROF.

>As a matter of fact, the table occupies1265649 data blocks....

????!!! In the TKPROF outputs there vere allways 39965 buffers accessed in query (consistent) mode and 2 buffers in current mode, which summs to "around 40.000 blocks". AFAIK TKPROF this is the number of db blocks that wrere accessed during full table scan, which means that many blocks are occupied by the table rows. Prety obvious to me. Can you elaborate where do you get your figure (1,265,649 blocks) and explain its correspondance with the numbers presented from TKPROF?

>On the other hand, the BITMAP index used by the select count(*)....

????!!! AFAIK use of bitmap index should be visible from the EXPLAIN PLAN output, while there were not a single word BITMAP in any of the presented accessed plans. So I'm quite positive on ordinary B-tree index was used in a query.

> ..index ... occupies 932 blocks

????!!!! My explanation is similar as the one for the table scan. From TKPROF outputs presented it is prety obvious to me that for full index scan 41975 db blocks were accessed, which is "aproximately 42.000 blocks". Again, can you explain a little more your number (932 blocks) in corespondence to TKPROF numbers?

>Maybe you should refrain from stating the obvious until you have all the
>facts.

Maybe so, but from what was presented in the bialik_at_wis.weizmann.ac.il's message, the facts I concluded as "obvious" are still prety obvious to me. Of course, untill someone points out where have I gone wrong in my conclusions/explanations.

Regards,


Jurij Modic                             Republic of Slovenia
jurij.modic_at_mf.sigov.mail.si		Ministry of Finance
============================================================
The above opinions are mine and do not represent any official standpoints of my employer Received on Sun May 03 1998 - 14:58:53 CDT

Original text of this message

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