Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: What's fast way to get total of records

Re: What's fast way to get total of records

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 25 Sep 2003 22:27:41 -0700
Message-ID: <1a75df45.0309252127.5fd23934@posting.google.com>

"zhao" <zhaohui_at_goconnect.net> wrote
>
> Can someone tell me what's fast way to get total of records in a table
> except using "select count(*)" statement? Can I get the information from a
> system table?

Fast? You mean something like this:

SQL> set timing on
SQL> select count(*) from tjs_batch.prod_sapcallusage200304;

  COUNT(*)



  78277166

Elapsed: 00:00:06.49
SQL> This is a straight cut-and-paste from a telnet session. The 6 seconds will go down to 4 or even 2 seconds when run again as the applicable bitmap index used will be cached.

So what's your reason for not wanting to use SELECT COUNT(*) or thinking its slow?

One thing that really makes me reach for my lead pipe, is Oracle urban legends Andy. Like thinking a SELECT COUNT(*) is slow, that standard Oracle database's uptime is much less than that of the server it runs on, that Oracle requires constant administration and a host more or other silly tales.

--
Billy
Received on Fri Sep 26 2003 - 00:27:41 CDT

Original text of this message

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