Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select count(*) in Oracle and MySQL
On Tue, 09 Oct 2007 08:35:09 -0700, fitzjarrell_at_cox.net wrote:
> Same elapsed time, fewer recursive calls for select count(*). I don't
> see the 'benefit' of using 'select count(rowid)'.
Sometimes even going through the primary key isn't the fastest way:
SQL> select /*+ index_ffs(no,PK_NI_OCCURRENCE_ID) */ 2 count(*) from ni_occurrence no;
COUNT(*)
Elapsed: 00:04:45.22
SQL> select count(*) from ni_occurrence;
COUNT(*)
Elapsed: 00:01:17.65
SQL>
(There was another, index, smaller then the primary key, that could be
used for this).
-- http://www.mladen-gogala.comReceived on Tue Oct 09 2007 - 11:13:18 CDT