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: Pierre Charpenay <pcharpenay_at_unilog.fr>
Date: Fri, 17 Dec 1999 13:42:04 +0100
Message-ID: <385A2F9C.F4F60C54@unilog.fr>


The best way I've found to speed up this sort of count, is to use an unique index associated with the table, using something like this :

select count(*) from my_table
where this_key > ' ' /* or any other value lower (alpha or numeric) than the minimum */

Of course the result will be accurate only if none of the key values are null (generally, it must be true!).

Pierre

Ken Sproule a écrit :

> 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 Fri Dec 17 1999 - 06:42:04 CST

Original text of this message

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