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: Finding total Rows without count() ?

Re: Finding total Rows without count() ?

From: bpolarsk <bpolarskNObpSPAM_at_yahoo.com.invalid>
Date: Wed, 15 Dec 1999 01:43:15 -0800
Message-ID: <2d56739d.40e0150f@usw-ex0107-041.remarq.com>


Hello

Here are some test run on a Sun 3500 :

09:35:40 SQL> select count(*) from parameter ;

  COUNT(*)


   5767134

Elapsed: 00:00:16.37

SQL> select count(1) from parameter ;

  COUNT(1)


   5767286

Elapsed: 00:00:17.77
SQL> select count(rownum) from parameter ;

COUNT(ROWNUM)


      5767323

Elapsed: 00:00:33.37
SQL> select max(rownum) from parameter ;

MAX(ROWNUM)


    5767607

Elapsed: 00:00:34.26
SQL> select count(rowid) from parameter ;

COUNT(ROWID)


     5767539

Elapsed: 00:00:21.09

SQL> analyze table parameter estimate statistics ;

Table analyzed.

Elapsed: 00:00:10.27

So the quickest way seems to be the analyze table, Shortly followed by select(1).

B. Polarski
www.geocities.com/bpolarsk
bpolarsk_at_yahoo.com
Elapsed: 00:00:21.09

SQL> select max(rownum) from parameter ;

MAX(ROWNUM)


    5767607

Elapsed: 00:00:34.26

Received on Wed Dec 15 1999 - 03:43:15 CST

Original text of this message

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