Re: serializing result sets or what?
| From: | Jasper Bryant-Greene | Date: | Wed, 28 Sep 2005 09:41:18 +0000 |
| Subject: | Re: serializing result sets or what? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-223341@lists.php.net to get a copy of this message | ||
Thomas wrote:
Q: What would be the best way to save db calls for large result sets? I thought about serializing the data and then caching it (with Cache_Lite - maybe there will be a future inclusion of such a caching scheme into the php core or pecl?). I was not sure about performance though (no time for benchmarking this). The issue is that as this system grows we get 2 - 3 db calls on the server (which is too much in my opinion), but will serializing be cheaper or simply the lesser of two evils?A very similar question was asked recently on this list. You might like to consider caching whatever you create from those result sets rather than the result sets themselves, but APC [1] is worth looking at as I believe it can cache (some?) PHP vars without serialisation, using apc_store() and apc_fetch(). The only way to know whether such a scheme would help in your specific situation is to benchmark. Go on, it won't take long! [1] http://php.net/apc -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/