Blueprint: Extbase Sql Cache
|Proposal||Add a first level cache for reducing sql queries in Typo3DbBackend.php|
|Participants/Members||Nico de Haen|
|Status||To be discussed|
|Topic for Gerrit||N/A|
Goals / Motivation
Extbase never had a cache for saving already queried data. So if you e.g. use findAll() on the same repository twice, two queries will be executed, fetching the same resultset. Actually there is somewhat like a cache in class QueryResult but it's just used if querying data from the resultset. If you use findAll() twice, two instances of QueryResult objects will be created, containing the same data, so this pseudo-cache is almost useless.
A solution to this problem would be to generate a unique signature for each Query object and implement a first level cache (runtime cache) that stores already fetched rows using the query signature. Fetching huge, nested object trees shouldn't be as expensive as it currently is. imho the implementation would be quite easy. This topic just has to be discussed first, so please don't hesitate to drop some lines.