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: NUM_ROWS vs COUNT(*) anomaly

Re: NUM_ROWS vs COUNT(*) anomaly

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Thu, 13 Jan 2000 10:51:42 +0100
Message-ID: <947757201.19420.0.pluto.d4ee154e@news.demon.nl>

The value in the dictionary is a result of ANALYZE table. This value is NOT updated dynamically, and you should not rely on it. The Count(*) result is correct.

Hth,
--
Sybrand Bakker, Oracle DBA
s. hunter <sarahxhunter_at_NOSPAMTHANX.hotmail.com> wrote in message news:387D969F.7E7B44AF_at_NOSPAMTHANX.hotmail.com...
> Hi,
>
> I noticed a weird anomaly when checking that the data in my database had
> loaded properly.
>
> If I do
>
> SELECT table_name, num_rows
> FROM user_tables
> WHERE table_name='table_A';
>
> I get a value for num_rows of 5424908.
>
> If, however I just do
>
> SELECT count(*)
> FROM table_A;
>
> I get a value of 5424804 (incidentally, the correct value).
>
> OK, so I know that num_rows is from the data dictionary and the count is
> directly on the table, but why are the values different? Any ideas??
>
> Thanks,
>
> Sarah
>
Received on Thu Jan 13 2000 - 03:51:42 CST

Original text of this message

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