At 2:26 AM +0200 7/13/08, Joep Roebroek wrote:
I had this question, which I didn't really know where to ask, so I
thought to begin at this mailing list.
Very basicly said, I count the rows of a table which had approx 50000
or more rows.
The problem is, there is a notable difference in loading time with
other pages. Is there a technique to estimate the number of rows
instead of exactly couting them? So that it saves loading time.
For example, when you search with google, you get an estimate of the
number of results, how do they do this?
Maybe this is not a question for the PHP Mailing list, but if not
where is a better place to ask this?
regards,
Joep
Joep:
If it was me and the number of rows were not critical, then I would
do it once a day and store that "count" in a table where I needed an
approximate number. Then loading that number for the rest of the day
would be instant.
You don't need a cron job for that, just tie a date to the "count"
entry and have each access to it compare the date with current date.
If the date is 24 hours since the last update, then that lucky person
has to wait a bit longer than most while a count is establish and
recorded.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php