[TYPO3-dev] Web->list very slow if tt_news-records and admin

Stefan Frömken firma at sfroemken.de
Thu Sep 1 13:09:41 CEST 2011


Hello DEV-Team,

we have 8 sysfolders containing between 1000 and 4000 tt_news-records.
The first click on a sysfolder needs 276 Milliseconds * 20 records = 5.5 
seconds. Displaying the single-table-view need 25 seconds. I have 
enabled debugging for table tt_news which tolds me that following query 
was executed for each record and needs round about 270 Milliseconds:

SELECT COUNT(*)
FROM tt_news
WHERE
l18n_parent=21193 AND sys_language_uid!=0 AND deleted=0

Debug-Backtrace:
require#51 // SC_db_list->main#514 // recordList->generateList#310 // 
localRecordList->getTable#303 // localRecordList->renderListRow#553 // 
localRecordList->makeControl#707 // t3lib_BEfunc::translationCount#1300 
// ux_t3lib_DB->exec_SELECTcountRows#3957 // 
ux_t3lib_DB->exec_SELECTquery#343 // ux_t3lib_DB->myDebug#232 // 
t3lib_div::debug_trail#826

When I click on a sysfolder with fe_users I don't have this problem.
After a long time of searching I found out that the problem is the admin 
in combination with delete-icon:

Admin:
In class.t3lib_userauthgroup.php you have a method called "calcPerms" 
which always returns 31 if you're an admin. There is no possibility to 
change this.

Delete-Icon:
In class.db_list_extra.inc on row 1286 you found a section drawing the 
"Delete-Icon". It will be executed if table is not "pages" and the first 
bit of calcPerms is 1. We are admin...so our calcPerms is 11111 (31). 
That meens everything is activated.
At row 1300 you found the function "t3lib_BEfunc::translationCount". 
Open it and you will find a big if-section:

if (empty($GLOBALS['TCA'][$table]['ctrl']['transForeignTable']) &&
$GLOBALS['TCA'][$table]['ctrl']['languageField'] &&
$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] &&
!$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable']) {

This is our problem! The ctrl-section of tt_news matches this condition 
exactly and executes the slowly query.

We have the idea to remove "sys_language-uid" from [ctrl][languageField] 
of tt_news to get this condition false.

But before doing so we hope you have a better idea.

Stefan




More information about the TYPO3-dev mailing list