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: analyze table with "list chainged rows" or "compute statistics"

Re: analyze table with "list chainged rows" or "compute statistics"

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 21 Apr 2001 22:55:58 +0200
Message-ID: <te3sr4ogjj5j9b@beta-news.demon.nl>

"David" <david_petit_at_yahoo.com> wrote in message news:3AE2AF56.E61BD2A2_at_yahoo.com...
> Hi all,
>
>
> I want to find the number of migrated rows in table testing. I found
> that I can use "analyze table testing list chainged rows" and "select
> count(*) from chained_rows" AND "analyze table testing compute
> statistics" and "select * from dba_tables where table_name = 'TESTING'".
> Which one is better and faster?
>
> Thanks,
> David

Two completely different commands, they are the former does nothing more and less than to dump the rowids of the affected rows in the chained_rows table. It doesn't compute any of the other statistics. Usually you have only one chained_rows table, so you need to include the table_name in your where clause to get the *correct* number of rows. The second statement determines all the statistics of a table, including the *number* of chained rows, but it doesn't do anything to the chained_rows table, so you will be unable to determine *which* rows are chained. You could simply use select table_name, chain_cnt from dba_tables to get results, and you should do this, because otherwise you will wade through results you don't want to see. So, evidently either statement has its merits, and it is up to you to choose. I use the first form only very rarely.

Regards,

Sybrand Bakker, Oracle DBA Received on Sat Apr 21 2001 - 15:55:58 CDT

Original text of this message

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