On Thu, Jan 31, 2002 at 03:49:29PM -0800, Michael Peppler wrote:
> They probably do a 
>      select count(*) from ... where ...
> to get that information.

And then cache it.

Tim.

> Michael
> 
> Moritz von Schweinitz writes:
>  > i would of course never dare to doubt the fine-ness of the manual, and
>  > am pressing for a nobel prize for literature for it, BUT:
>  > 
>  > is there really no resource-friendly, fast&simple way to find out how
>  > many rows a query could return, without weeding thru all the rows - i
>  > somehow doubt that websites that claim "we have 1.234.678 [whatever]
>  > registered in our database" run thru their whole database every time. my
>  > is that they store the number of entries every time they do an "INSERT",
>  > but still...
>  > 
>  > (i'm using mysql v3.23, but i think this is a more general
>  > db-engineering problem)
>  > 
>  > M.
>  > 
>  > > -----Original Message-----
>  > > From: Michael A Chase [mailto:[EMAIL PROTECTED]] 
>  > > Sent: Thursday, January 31, 2002 5:23 PM
>  > > To: Zhao, David [PRDUS Non J&J]; [EMAIL PROTECTED]
>  > > Subject: Re: how to get row count using DBI
>  > > 
>  > > 
>  > > Count the rows as you process them.  There is a $sth->rows 
>  > > method, but read the fine manual (perldoc DBI) to see why it 
>  > > isn't a good idea to depend on it for SELECT.
>  > > 
>  > > --
>  > > Mac :})
>  > > ** I normally forward private questions to the appropriate 
>  > > mail list. ** Ask Smarter: 
>  > > http://www.tuxedo.org/~esr/faqs/smart-> questions.htm
>  > > Give a 
>  > > hobbit a fish and he eats fish for a 
>  > > day.
>  > > Give a hobbit a ring and he eats fish for an age.
>  > > ----- Original Message -----
>  > > From: "Zhao, David [PRDUS Non J&J]" <[EMAIL PROTECTED]>
>  > > To: <[EMAIL PROTECTED]>
>  > > Sent: Thursday, January 31, 2002 13:44
>  > > Subject: how to get row count using DBI
>  > > 
>  > > 
>  > > > How can I get row count information from DBI?
>  > > 
>  > > 
>  > > 
>  > 
> 
> -- 
> Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
> [EMAIL PROTECTED] - [EMAIL PROTECTED]
> International Sybase User Group - http://www.isug.com

Reply via email to