[TYPO3-core] RFC #13273: Bug: Caching framework sub-select is slow because mysql does not use indexes on outer query

Jigal van Hemert jigal at xs4all.nl
Tue Mar 30 01:18:54 CEST 2010


Christian Kuhn schreef:
>> BT reference: http://bugs.typo3.org/view.php?id=13273
>> Solution:
>> Separate queries and do more logic with php.

If it's the query

DELETE FROM cachingframework_cache_pages WHERE identifier IN (SELECT 
identifier FROM cachingframework_cache_pages_tags WHERE 
cachingframework_cache_pages_tags.tag = 'pageId_46');

which causes the problem, why not rewrite it to:

DELETE cachingframework_cache_pages FROM cachingframework_cache_pages 
JOIN cachingframework_cache_pages_tags USING (identifier) WHERE 
cachingframework_cache_pages_tags.tag = 'pageId_46';

or

DELETE cachingframework_cache_pages FROM cachingframework_cache_pages 
JOIN cachingframework_cache_pages_tags ON 
cachingframework_cache_pages.identifier = 
cachingframework_cache_pages_tags.identifier WHERE 
cachingframework_cache_pages_tags.tag = 'pageId_46';

Are there problems with DBAL that prevent this syntax from being used?

--
Jigal van Hemert.


More information about the TYPO3-team-core mailing list