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: 8 Oct 2003 05:59:29 -0700
Message-ID: <1a75df45.0310080459.73fad98e@posting.google.com>


joel-garry_at_home.com (Joel Garry) wrote

> I agree with you, but no one had directly answered the OP with this.

Yeah, but with good reason Joel. :-)

The OP has a performance problem using SELECT count(*).

He naturally assumes that the SELECT count(*) is at fault and the actual problem. A "bad thing" to use.

So now he looks for an alternative - digging in the system tables for an alternative answer.

The issue IMO is *ignoring* the problem and treating the symptom. "Oh, SELECT count(*) does not work so I'm not going to use it.. Hmmm... what else can I hack and use..?".

Such an approach is based on nothing but pure ignorance. Making it a pretty dangerous approach.

Is a SELECT count(*) by nature slow? No. And I have *proved* and shown this in this thread. Hell, 77 million count(*) on a VLT in less than 7 seconds.

So,

Step 1. Realise that SELECT count(*) itself is not the problem. Step 3. Determine the factors that causes the SELECT count(*) to be slow.
Step 5. Address those factors.

Steps 2 and 4? They are reserved for the consumption and enjoyment of vast amounts of coffee.

--
Billy
Received on Wed Oct 08 2003 - 07:59:29 CDT

Original text of this message

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