Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Finding total Rows without count() ?
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