[TYPO3-dev] Further development of DBAL

Andreas Fernandez andreas.fernandez at aspedia.de
Fri Aug 8 14:46:27 CEST 2014


Hi,

I pushed a patch to change the subselect to a LEFT JOIN: 
https://review.typo3.org/#/c/32062/
I'm sorry for uploading many patch sets, I definitively need some coffee...

Andreas

Am 08.08.2014 12:09, schrieb Jigal van Hemert:
> Hi,
>
> On 7-8-2014 22:22, Andreas Fernandez wrote:
>> At least I can bypass the subselect used in
>> "fetchMaximalVersionsForAllExtensions" by
>> changing the query. The changed query is a bit buggy since it misses ~30
>> extensions
>> which are covered by the  currently used query.
>> Here is a pastebin to the change and it's impact:
>> http://pastebin.com/ESZYX6LU
>
> These are two rather different queries. The one with the HAVING clause 
> just limits the returned grouped records which have 
> MAX(integer_version) > 0.
>
> If you look in the results you'll notice that the result set of the 
> query with the HAVING clause has records with current_version = 0 (and 
> also often not the highest available version number), while the one 
> with the sub query only has the most recent versions.
>
> The sub query is there to make sure that the latest version of the 
> extension is used in the group; HAVING will not have that effect.
>
> The current solution is rather inefficient (it uses a correlated 
> subquery) and can be optimized with either a uncorrelated subquery or 
> a left join (see [1]) . Especially the left join solution will be DBAL 
> compatible AFAIK.
>
> [1] 
> http://dev.mysql.com/doc/refman/5.5/en/example-maximum-column-group-row.html
>




More information about the TYPO3-dev mailing list