> > He wants to know the maximum, like on a search for mysql at
> > google it says "Results 1 - 10 of about 2,580,000." He wants
> > to know that 2,580,000 number without doing another query.
> > I don't think that's possible.
>
> Of course it is. That's what I do all the time. That's what I was
> talking about. I am looking at the result of my query. Then I
> know how many I have. I won't and cannot show all of them, if
> there are too many. So I check and repost that query with a LIMIT
> constraint.

I said "without doing another query" :-) Sure you can do count(*)
beforehand...

Also, you can't really do select * from table, get the number of rows, and
just stop fetching rows after your limit is reached, cause that would waste
the resources of preparing the entire result set.

One thing I would like to know is how Google does "about 2,540,000" instead
of an exact number (does it just get the exact number and round it off, or
does it do an estimation that is somehow less resource intensive... then
again I think they have some funky system so that their database of words
fits in ram).


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to