ADOdb: Caching of RecordsetTag: adodb, database, database layer Category: PHP Databasepost: 30 Oct 2007 read: 1,773 It's cute feature in adodb, caching of recordset. It will fast result your query. Several method cache recordset: CacheExecute()CachePageExecute() CacheSelectLimit() CacheExecute() Similar to Execute, except that the recordset is cached for $secs2cache seconds in the $ADODB_CACHE_DIR directory. If CacheExecute() is called again with the same parameters, same database, same userid, same password, and the cached recordset has not expired, the cached recordset is returned
CachePageExecute() formula:
Used for pagination of recordset. $page is 1-based.
CacheSelectLimit() Formula:
Similar to SelectLimit, except that the recordset returned is cached for $secs2cache seconds in the $ADODB_CACHE_DIR directory.
I have done some benchmarks and found that they vary so greatly that it's better to talk about when caching is of benefit. When your database server is much slower than your Web server or the database is very overloaded then ADOdb's caching is good because it reduces the load on your database server. If your database server is lightly loaded or much faster than your Web server, then caching could actually reduce performance (note from manual). |
| | Give Your Opinion | Recommend |
|

