[TYPO3-mvc] RFC #12213: Repository countAll() dosn't honor sys_language_uid

Kevin Ulrich Moschallski km at 3digit.de
Fri Jan 14 15:02:55 CET 2011


On 2011-01-14 14:08:37 +0100, Franz Koch said:

> Hey,
> 
>> i thought so, but can't find it. Maybe Sebastian could remember or tell
>> us. He seems to be the author of the class.
> 
> I can tell you the reason -> performance. Your current solution would 
> fetch ALL objects from DB, perform the overlays etc and after that 
> perform a simple count. This is way to much overhead and could in the 
> worst case lead to memory_issues having to fetch thousands of objects 
> only to perform a simple count. So there has to be a different/better 
> solution for this.
> 
> 
> The splitted count queries where also created because of performance. 
> In general, sql_num_rows would be fine, but is slower then COUNT(*). 
> But sql_num_rows is needed for queries already having a LIMIT applied, 
> because COUNT doesn't work with a LIMIT or simply ignores it.

Hi Franz,

thanks for the information. I already thought that it was for 
peformance. When using COUNT(*) and sql_num_rows i see no other way 
than adding a WHERE sys_language_id = x to the query. Do you agree?

Regards,
Kevin



More information about the TYPO3-project-typo3v4mvc mailing list