Re: Trying to loop through MDB rowset -
| From: | Manuel Lemos | Date: | Thu, 07 Nov 2002 21:17:59 +0000 |
| Subject: | Re: Trying to loop through MDB rowset - | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2665@lists.php.net to get a copy of this message | ||
Hello,
On 11/07/2002 06:27 PM, Matt Friedman wrote:
My thinking is that it's probably not too significant unless the result set is very large. But to really know someone would have to benchmark it I guess. Just something to ponder. I'll continue to work with the current functionality. Thanks for all the work on MDB.You just need to use common sense here. Using fetch all functions is really just a convinience function so you need to write less code. It would be faster and take less memory if you just fetch a row at a time and process it imediately before fetching the following row. If you absolutely need to maximize the performance, you should resort to caching. I usually don't advise caching the database query results because the gains may not be significant. What I advise is to cache what is generated from those database query results, like Web pages, XML documents, etc.. That way the performance gains are often dramatic. In extreme cases you may want to consider resorting to static generation where the pages or whatever you serve in your site is rendered once and stored as static pages. This is the fastest solution because no PHP engine is necessary to serve pages many times and so it also saves memory besides CPU, but it is limited to non-personalized pages. I use both types of performance improvement in very busy sites like the phpclasses.org site that has even the aditional challenge of being mirrored by tens of other sites. -- Regards, Manuel Lemos