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: <JApplewhite_at_austin.isd.tenet.edu>
Date: Thu, 19 Sep 2002 15:48:21 -0800
Message-ID: <F001.004D473D.20020919154821@fatcity.com>

If you can modify the application code, how about incrementing a sequence for each row inserted? Not to hamper performance with a "Select MySequence.NextVal From Dual" you could select from - I vaguely remember this from a thread a few weeks ago - x$dual (or something like that - I can't remember how to set this up, maybe you could check the archives).

Then you could simply query User_Sequences.Last_Number every 10 minutes to see how many rows you've inserted.

If you can't modify the application code, how about an After Insert Row trigger on the table that would increment the sequence?

It might work for you.

Jack C. Applewhite
Database Administrator
Austin Independent School District
Austin, Texas
512.414.9715
JApplewhite_at_austin.isd.tenet.edu

                                                                                                  
                    Rishi.Jain_at_verizonwi                                                          
                    reless.com                 To:     Multiple recipients of list ORACLE-L       
                    Sent by:                    <ORACLE-L_at_fatcity.com>                            
                    root_at_fatcity.com           cc:                                                
                                               Subject:     count(*)                              
                                                                                                  
                    09/19/2002 01:28 PM                                                           
                    Please respond to                                                             
                    ORACLE-L                                                                      
                                                                                                  
                                                                                                  




Hi Gurus,

In one of our insert intensive application we are inserting around 3-4 million rows / hour. Also this app needs to do a count(*) of the tables every 10 minutes for verifying some application based logic. This is really killing us and it takes a lot of time.

Can you please guide me to a direction ( built in functions or something similar).

Actually this app is being ported from Informix. Informix can somehow keep a
trak of the count(*) of a table in its header somewhere.

And yes I have tries count(1) , count(indexed_column) etc.

Thanks In Advance.

R.h

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: JApplewhite_at_austin.isd.tenet.edu

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 - 18:48:21 CDT

Original text of this message

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