Re: Performance off "count(*)"

  • From: "Jonathan Lewis" <jonathan@xxxxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Sat, 19 Jul 2008 14:36:18 +0100


The number of gets might be the same, but the
name of the call used to do the get could be
different if there's some code which says:
 if it's a nice block do X otherwise do Y
rather than code that simply says
 do Y


Jonathan Lewis

Author: Cost Based Oracle: Fundamentals

The Co-operative Oracle Users' FAQ

----- Original Message ----- From: "Nuno Souto" <dbvision@xxxxxxxxxxxx>
Cc: <oracle-l@xxxxxxxxxxxxx>
Sent: Saturday, July 19, 2008 10:58 AM
Subject: Re: Performance off "count(*)"

This was my understanding as well:  x$kcbsw shows the
same number of blocks, because regardless of count(*)
counting the rows in the block header or traversing the
row chain in the block, the block itself must be read
in both cases.  What might be saved is the CPU spent
traversing the block.  That might be relevant for very
small rows and/or very large blocks, with many rows
per block?


Other related posts: