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

Christian Kuhn lolli at schwarzbu.ch
Fri Mar 26 15:50:42 CET 2010


Hey Susanne.

Susanne Moog wrote:
>> Problem:
>> mysql is unable to use indexes for outer query if where clause is a sub
>> select [1]. This makes tag-deletion in the caching framework with db
>> backend very slow on bigger tables because mysql happily decides to
>> perform a full table scan.
>>
>> Solution:
>> Separate queries and do more logic with php.

> I noticed one thing by reading:
> 
> $tagsTableWhereClause = $this->getQueryForTag($tag);
> 
> (...)
> $GLOBALS['TYPO3_DB']->exec_DELETEquery(
> 	$this->tagsTable,
> 	$this->getQueryForTag($tagsTableWhereClause)
> );
> 
> 
> The last param of the query should probably be only
> $tagsTableWhereClause, without the additional "getQueryForTag".


Thanks for review and good catch! This is obviously wrong, I wonder why 
the testcases didn't catch this, will dig a bit.

Regards
Christian


More information about the TYPO3-team-core mailing list