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: fumi <fumi_at_tpts5.seed.net.tw>
Date: 16 Dec 1999 15:28:14 GMT
Message-ID: <83b0ee$qb4$3@news.seed.net.tw>

Dave Smith <dave_at_nospam.net> wrote in message news:3856fc6e_3_at_news3.prserv.net...
> Ken,
>
> How about the psuedo column ROWNUM?
>
> Select max(ROWNUM) from yourtable
>
> Hopefully MAX() is faster than COUNT()

No.
Using max(rownum) must count the rows, and perform a number for each rows. It takes about more 10% time than the native way 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.

No. Again, it needs to perform additional work. Received on Thu Dec 16 1999 - 09:28:14 CST

Original text of this message

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