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

Re: Finding total Rows without count() ?

From: Dave Smith <dave_at_nospam.net>
Date: Tue, 14 Dec 1999 21:26:07 -0800
Message-ID: <3856fc6e_3@news3.prserv.net>


Ken,

How about the psuedo column ROWNUM?

Select max(ROWNUM) from yourtable

Hopefully MAX() is faster than COUNT()

The only other kludge I can think of is adding a column filled with 1s (ONE) and doing a count on it.

Select COUNT(ONE) from yourtable.

Dave

Ken Sproule <kenmn_at_tds.net> wrote in message news:brrd5s8pcpj2mo80gbjtsc2mmf99n7ppcc_at_4ax.com...
> As always, thanks in advance for your help.
>
> I need a fast way to determine the total number of rows in a table. I
> assume somewhere Oracle stores such information about its tables.
> Where is it?
>
> The count() type syntaxes take much too long on tables of say 3+
> million rows, so I'm looking for a fast way to accomplish it.
>
> Post answers to the group, as others might be interested also.
>
> Thanks,
>
> Ken Sproule
> kenmn_at_tds.net
>
>
Received on Tue Dec 14 1999 - 23:26:07 CST

Original text of this message

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