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: determine num rows in a table without doing a count(*)

Re: determine num rows in a table without doing a count(*)

From: Nuno Souto <nsouto_at_nsw.bigpond.net.au.nospam>
Date: Wed, 28 Mar 2001 13:02:54 GMT
Message-ID: <3ac1df7b.11699719@news-server>

On Tue, 27 Mar 2001 13:54:13 -0500, "Rocr" <rolland.cright_at_pwgsc.gc.ca> wrote:

>I could do a count but I am writing a script that will identify tables that
>have large amounts of records and candidates for re-orgs. However I want to
>set a threshold (20,000 records).
>

IMHO, if you want to identify candidates for reorgs, you're better off looking at the space allocated rather than the number of rows. I'd go for DBA_SEGMENTS or USER_SEGMENTS and look at the EXTENTS column for all SEGMENT_TYPE = 'TABLE'. That will pinpoint them much faster and easier. You can do all sorts of order by on the result set for all sorts of interesting info (by tablespace, by owner, etc).

HTH Cheers
Nuno Souto
nsouto_at_bigpond.net.au.nospam
http://www.users.bigpond.net.au/the_Den/index.html Received on Wed Mar 28 2001 - 07:02:54 CST

Original text of this message

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