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

Home -> Community -> Usenet -> c.d.o.server -> Re: Any way to get RowCound by not using Select count(*) from table

Re: Any way to get RowCound by not using Select count(*) from table

From: MarkP28665 <markp28665_at_aol.com>
Date: 28 Dec 1998 22:03:18 GMT
Message-ID: <19981228170318.12603.00002826@ng-cr1.aol.com>


From: "boonsong" >>
Any way to get RowCound by not using Select count(*) from table <<

If you need an exact count, not really. If all you need is an approximate count you can query the num_rows column in all_tables. But statistics are static so the count can be off.

It is possible to write the query such that the count is done on the primary key so that only the index is read and not the table. Where a count performed against the table may take too long to be practical this little change may be an acceptable alternate.

Mark Powell -- Oracle 7 Certified DBA
- The only advice that counts is the advice that you follow so follow your own advice - Received on Mon Dec 28 1998 - 16:03:18 CST

Original text of this message

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