Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: What's fast way to get total of records
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.
-- BillyReceived on Wed Oct 08 2003 - 07:59:29 CDT