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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: count(*)

RE: count(*)

From: Craig Munday <Craig.Munday_at_ecard.com.au>
Date: Thu, 19 Sep 2002 16:53:23 -0800
Message-ID: <F001.004D479C.20020919165323@fatcity.com>






RE: count(*)



Hi,

I am not sure if I have a solution for you, but I have a number of questions:

1) just for my interest, what type of application would need to insert 3-4 million records per hour?

2) Why does the application need to do the select count(*)....?  What verification is being performed?

3) Perhaps the design of the application could change so the number of records is reduced?

Cheers,
Craig.
 

-----Original Message-----
From: Reginald.W.Bailey@jpmorgan.com
[mailto:Reginald.W.Bailey@jpmorgan.com]
Sent: Friday, 20 September 2002 9:53 AM
To: Multiple recipients of list ORACLE-L
Subject: RE: count(*)



Paula et al:

It could work if the analyze is done after the load using DBMS_STATS. Then
the num_rows would be accurate.  With the monitoring turned on , analyzing
would be done on the
table if more than a certain percentage had changed.  It is not an elegant
solution.  A more pratical one , if you're using SQL Loader, is to use a
counter variable. If not using SQL Loader, then a synthetic key backed with
a trigger and sequence, could suffice.  It could give you the accurate
count after a load by checking the NEXTVAL.sequence_name or
CURRENTVAL.sequence_name.  The method could be put in a procedure to
improve efficiency.

Just a thought.

RWB

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Craig Munday
  INET: Craig.Munday_at_ecard.com.au

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Sep 19 2002 - 19:53:23 CDT

Original text of this message

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