Logical help for storing data in cache or no |
[eluser]veledrom[/eluser]
Hi, This is pagination purposes. I have a table with 2.000.000+/- records in database. My query returns average 20.000 records. I store it in cache philsturgeon for 5 minutes so every page request done in 5 minutes reads records from cache, no query sent to database. I know that we normally send queries to database with LIMIT and OFFSET parts (takes about 2 minutes) but in this case same logic is applied against cache with array_slice(array, OFFSET, LENGTH) function (takes less than half a second). Do you think sending queries to database is better than using cache in this case, or I'm on right track? Code: $cache_name = $this->cache_name_initials . '-' . $postcode . '-' . $within; Thanks |
Messages In This Thread |
Logical help for storing data in cache or no - by El Forum - 06-11-2012, 02:20 PM
|