Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Difference between NUM_ROWS and COUNT(*)

Re: Difference between NUM_ROWS and COUNT(*)

From: Lee Kyoung Rok <tunnel_at_hananet.net>
Date: Fri, 17 Dec 1999 00:44:01 +0900
Message-ID: <uO764.1100$jz5.36336@news.hananet.net>

Thomas Klinger <t.klinger_at_nospam.mobilkom.at>ÀÌ(°¡) ¾Æ·¡ ¸Þ½ÃÁö¸¦ news:83apbn$oog$1_at_fleetstreet.Austria.EU.net¿¡ °Ô½ÃÇÏ¿´½À´Ï´Ù.
> Hi there!
>
> A small question:
> what's the difference between NUM_ROWS ind USER_TABLES and COUNT(*) from
the
> same table?
> i.e. in USER_TABLES I have for the table X the value 32410 in NUM_ROWS.
With
> a select count(*) from X; I get the value 38986.
> Does the second value depends on the High-Watermark? Or is there some
other
> reason?

When u issue command like below

ANALYZE TABLE tablename COMPUTE STATISTICS;

information of tablename is write into dba/user_tables. It does not update automatically. So if you do not issue the command again it has same data forever.
This means that u issue above command when your table has 32410 rows in it, but now the table has 38986 rows. If you want get same value issue above command again after every insert or delete.

*^^* Received on Thu Dec 16 1999 - 09:44:01 CST

Original text of this message

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