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: Stephan Born <stephan.born_at_beusen.de>
Date: Mon, 20 Dec 1999 11:41:51 +0100
Message-ID: <385E07EF.D1792EEC@beusen.de>

Thomas Klinger schrieb:

> 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?
>
> Thanks for the answer.
>

The value NUM_ROWS in USER_TABLES is the amount of rows for the table X at the moment
when this table was analyzed with the ANALYZE-command. It will be out of date the very next moment
when some rows inserted in or deleted from that table. COUNT(*) always returns the current amount
of rows.

Regards, Stephan

--


Dipl.-Inf. (FH) Stephan Born   | beusen Consulting GmbH
fon: +49 30 549932-0           | Landsberger Allee 392
fax: +49 30 549932-29          | 12681 Berlin
mailto:stephan.born_at_beusen.de  | Germany
---------------------------------------------------------------
       PGP-Key verfügbar       |      PGP-Key available
---------------------------------------------------------------


Received on Mon Dec 20 1999 - 04:41:51 CST

Original text of this message

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