Re: Oracle10g, Need to find number of rows in each table in a schema

From: Ana C. Dent <anacedent_at_hotmail.com>
Date: Sun, 05 Nov 2006 00:39:12 GMT
Message-ID: <Xns9871A96898ACFanacedenthotmailcom_at_69.28.173.184>


"RA" <angani_at_gmail.com> wrote in news:1162598699.771360.317470 _at_h48g2000cwc.googlegroups.com:

>>
>> SELECT table_name, num_rows
>> FROM all_tables
>> WHERE owner = <some_value>;
>>
>> won't work for what reason?

>
> Hi Mogan,
>
> I am sorry to say, your query will not give you the right count.
>
> Steps to follow is
> 1) analyze the tables
> 2) SELECT table_name, num_rows FROM all_tables WHERE owner =
> <some_value>
>
>
> But my question is why even bother to analyze.
>
> There should be better sql to write this, All I can think is INDEX
> table should be joined to get the correct count. I don't have the
> answer yet will let you know, when i have it.
>
> RA
>

You do realize that NULL values are not indexed; which might impact count accuracy. Received on Sun Nov 05 2006 - 01:39:12 CET

Original text of this message