Re: Performance off "count(*)"

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


I think it might be possible to:
check the clean SCN
check the transaction count
check that all transactions are committed
and deduce from this whether or not it was okay
to count the number of rows in the block from the "row index" area, excluding null pointers.

For blocks with a large enough number of rows this might be more efficient than walking the row lengths.


Jonathan Lewis

Author: Cost Based Oracle: Fundamentals

The Co-operative Oracle Users' FAQ

----- Original Message ----- From: "Tanel Poder" <tanel.poder.003@xxxxxxx>
To: <greg@xxxxxxxxxxxxxxxxxx>; <Marco.Gralike@xxxxxxx>
Cc: <oracle-l@xxxxxxxxxxxxx>
Sent: Saturday, July 19, 2008 7:53 AM
Subject: RE: Performance off "count(*)"

Hi Greg,

As far as I know the "nrow" in block header stores number of all row
structures in a block, including deleted rows (with delete flag set in row
header) and continued row pieces (chained rows) so Oracle still has to go to
individual row header to determine whether to count it or not...

Tanel Poder


Other related posts: