RE: Counting number of rows, sequences

  • From: John Kanagaraj <john.kanagaraj@xxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 18 Feb 2004 08:47:51 -0800

If you enable MONITORING on tables, you should be able to generate a
_reasonable_ number using a combination of NUM_ROWS from an ANALYZEd table
and number of new INSERTS/DELETES from DBA_TAB_MODIFICATIONS. This of course
does not cater to rollbacks, but it _does_ cater to aged (aging) Table
statistics.

John Kanagaraj <><
DB Soft Inc
Phone: 408-970-7002 (W)

Grace - Getting something we do NOT deserve
Mercy - NOT getting something we DO deserve
Click on 'http://www.needhim.org' for Grace and Mercy that is freely
available!

** The opinions and facts contained in this message are entirely mine and do
not reflect those of my employer or customers **
>-----Original Message-----
>From: oracle-l-bounce@xxxxxxxxxxxxx 
>[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Juan 
>Cachito Reyes Pacheco
>Sent: Wednesday, February 18, 2004 5:50 AM
>To: oracle-l@xxxxxxxxxxxxx
>Subject: Re: Counting number of rows, sequences
>
>
>To use a sequences is a good idea ALWAYS this is a table that 
>only inserts
>tables, and few deletes and rollbacks.
>if you rollback or delete (unless you rollback or delete too 
>much records),
>there will be a small difference you could fix every day or every week.
>I think the point here is to give ideas, maybe from one of 
>them we will get
>a better one.
>
>I think the only real solutions I personally see is COUNT(*), 
>or get it from
>recent statistics.
>But other ideas could be usefull in some specific situation like t his.
>
>----- Original Message ----- 
>From: "Mark Leith" <mark@xxxxxxxxxxxxxxxx>
>To: <oracle-l@xxxxxxxxxxxxx>
>Sent: Wednesday, February 18, 2004 5:15 AM
>Subject: RE: Counting number of rows, sequences
>
>
>And what happens when any rows get deleted? ;)
>
>
>-----Original Message-----
>From: oracle-l-bounce@xxxxxxxxxxxxx
>[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Jan Pruner
>Sent: 17 February 2004 22:31
>To: oracle-l@xxxxxxxxxxxxx
>Subject: Re: Counting number of rows, sequences
>
>
>Sorry to say it, but this is not a good idea.
>Sequence doesn't rollback in case the transaction is not commited. And
>CURRVAL is local to user session. "Note that before you use CURRVAL for
>a sequence in your session, you
>must first initialize the sequence with NEXTVAL."
>
>JP
>
>Juan Cachito Reyes Pacheco wrote:
>
>> The other choice if you have to frecuently do counts to that table is
>> a sequence
>>
>> You create an addiatoinal field with a sequence
>>
>> CREATE SEQUENCE, etc.
>>
>> row  sequence
>>
>> 1       1
>> 2        2
>> ....
>> 1234  1234
>
>----------------------------------------------------------------
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>----------------------------------------------------------------
>To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx put
>'unsubscribe' in the subject line.
>--
>Archives are at //www.freelists.org/archives/oracle-l/
>FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
>-----------------------------------------------------------------
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.581 / Virus Database: 368 - Release Date: 09/02/2004
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.581 / Virus Database: 368 - Release Date: 09/02/2004
>
>
>----------------------------------------------------------------
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>----------------------------------------------------------------
>To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
>put 'unsubscribe' in the subject line.
>--
>Archives are at //www.freelists.org/archives/oracle-l/
>FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
>-----------------------------------------------------------------
>
>
>----------------------------------------------------------------
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>----------------------------------------------------------------
>To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
>put 'unsubscribe' in the subject line.
>--
>Archives are at //www.freelists.org/archives/oracle-l/
>FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
>-----------------------------------------------------------------
>
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: