Re: Performance off "count(*)"

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sat, 19 Jul 2008 09:25:48 +0100
Message-ID: <056201c8e979$0da37570$4001a8c0@Primary>

Tanel,

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.

Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

  • Original Message ----- From: "Tanel Poder" <tanel.poder.003_at_mail.ee> To: <greg_at_structureddata.org>; <Marco.Gralike_at_amis.nl> Cc: <oracle-l_at_freelists.org> 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...
>
> --
> Regards,
> Tanel Poder
> http://blog.tanelpoder.com
>

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Jul 19 2008 - 03:25:48 CDT

Original text of this message