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




[EMAIL PROTECTED]@fatcity.com on 09/19/2002 05:38:24 PM

Please respond to [EMAIL PROTECTED]



Sent by:  [EMAIL PROTECTED]


To:   Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
cc:




That won't work if he is constantly loading data as analyze is going to
take longer then just the count(*).� What about writing in the load process
or a trigger itself a variable with a running total could use dbms_output
to write it out to a file.� Starting with existing rowcount this would be
the fastest as you would really not have any additional I/O - just a
counter.

-----Original Message-----
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 5:34 PM
To: Multiple recipients of list ORACLE-L


Try this:

select table_name, num_rows from dba_tables where table_name
= [table_name];

[table_name] = the name of the table or a variable.
This works if you are updating your statistics and you may also want
monitoring turned on for the table.
It is easier to get the information from the data dictionary sometimes,
than actually doing a count of rows. This is Oracle8i or above, right?

RWB




[EMAIL PROTECTED]@fatcity.com on 09/19/2002 01:28:27 PM

Please respond to [EMAIL PROTECTED]


Sent by:� [EMAIL PROTECTED]

To:�� Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
cc:

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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).


--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
� INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).




--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to