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: Counting number of rows

Re: Counting number of rows

From: Mladen Gogala <mladen_at_wangtrading.com>
Date: Tue, 17 Feb 2004 16:56:51 -0500
Message-ID: <20040217215651.GC22451@mladen.wangtrading.com>


I was already afraid that my function might be selected as the weapon of choice.

On 02/17/2004 04:46:27 PM, "Potluri, Venu (CT Appl Suppt)" wrote:
> We do analyze some schemas daily. So I will use num_rows. Thanks to
> all that responded.
> > -----Original Message-----
> > From: oracle-l-bounce_at_freelists.org
> [SMTP:oracle-l-bounce_at_freelists.org] On Behalf Of Ryan
> > Sent: Tuesday, February 17, 2004 4:41 PM
> > To: oracle-l_at_freelists.org
> > Subject: Re: Counting number of rows
> >
> > if the table is analyzed just go to dba_Tables.num_rows
> >
> > bitmap indexes are very fast on counts.
> > ----- Original Message -----
> > From: "Mladen Gogala" <mladen_at_wangtrading.com>
> > To: <oracle-l_at_freelists.org>
> > Sent: Tuesday, February 17, 2004 4:15 PM
> > Subject: Re: Counting number of rows
> >
> >
> > > The function below would count rows extremely quickly, and is
> > > independent of the table size. Even better, it is completely
> accurate
> > > and doesn't rely on the underlying statistics. The table
> > > in question may not even be analyzed. It does have one minor
> > > shortcoming, however.
> > >
> > > <PRANK>
> > > create or replace
> > > function count_rows(tbl in varchar2) return number deterministic
> > > as
> > > TRUNC VARCHAR2(128):='truncate table '||tbl;
> > > begin
> > > execute immediate trunc;
> > > return(0);
> > > end;
> > > /
> > > </PRANK>
> > > On 02/17/2004 03:27:31 PM, "Potluri, Venu (CT Appl Suppt)" wrote:
> > > > Is there a quick way to count number of rows in a table? Don't
> want
> > > > to
> > > > do select count(*) from..... on a table (such as GL_BALANCES)
> with
> > > > more than 250 million rows.
> > > > --------------------------------------------------------
> > > >
> > > > If you are not an intended recipient of this e-mail, please
> notify
> > > > the
> > > > sender, delete it and do not read, act upon, print, disclose,
> copy,
> > > > retain or redistribute it. Click here for important additional
> terms
> > > > relating to this e-mail. http://www.ml.com/email_terms/
> > > > --------------------------------------------------------
> > > >
> > > >
> >
> ============================================================================
> > ==
> > > >
> > > > If you are not an intended recipient of this e-mail, please
> notify
> > > > the sender, delete it and do not read, act upon, print,
> disclose,
> > > > copy, retain or redistribute it.
> > > >
> > > > Click here for important additional terms relating to this
> e-mail.
> > > > <http://www.ml.com/email_terms/>
> > > >
> > > >
> >
> ============================================================================
> > ==
> > > >
> > > >
> ----------------------------------------------------------------
> > > > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > > >
> ----------------------------------------------------------------
> > > > To unsubscribe send email to: oracle-l-request_at_freelists.org
> > > > put 'unsubscribe' in the subject line.
> > > > --
> > > > Archives are at http://www.freelists.org/archives/oracle-l/
> > > > FAQ is at http://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_at_freelists.org
> > > put 'unsubscribe' in the subject line.
> > > --
> > > Archives are at http://www.freelists.org/archives/oracle-l/
> > > FAQ is at http://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_at_freelists.org
> > put 'unsubscribe' in the subject line.
> > --
> > Archives are at http://www.freelists.org/archives/oracle-l/
> > FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> > ----------------------------------------------------------------->
> --------------------------------------------------------
>
> If you are not an intended recipient of this e-mail, please notify
> the
> sender, delete it and do not read, act upon, print, disclose, copy,
> retain or redistribute it. Click here for important additional terms
> relating to this e-mail. http://www.ml.com/email_terms/
> --------------------------------------------------------
>
>
> ==============================================================================
>
> If you are not an intended recipient of this e-mail, please notify
> the sender, delete it and do not read, act upon, print, disclose,
> copy, retain or redistribute it.
>
> Click here for important additional terms relating to this e-mail.
> <http://www.ml.com/email_terms/>
>
> ==============================================================================
>
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://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_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Feb 17 2004 - 15:56:51 CST

Original text of this message

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