Bug #82730

Opening record in backend painfully slow with foreign table and large main table

Added by Stefan Franke 2 months ago. Updated about 1 month ago.

Must have
FormEngine aka TCEforms
Target version:
Start date:
Due date:
% Done:


TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


Opening a record in the backend can become painfully slow under the following circumstances:

The main table (10.000 records) has got a 1:n relation to a foreign table (3 records). When trying to open the record of the main table in the TYPO3 backend, the following SQL statement is executed that often that it takes an exceptionally long amount of time to actually open the record.

SELECT * FROM `tx_myext_domain_model_foreigntable` WHERE (`uid` = ?) AND (`tx_myext_domain_model_foreigntable`.`deleted` = 0)

TCA of main table:

'attribute' => [
    'exclude' => true,
    'label' => 'attribute',
    'config' => [
        'type' => 'select',
        'renderType' => 'selectSingle',
        'foreign_table' => 'tx_myext_domain_model_foreigntable',

Related issues

Related to TYPO3 Core - Bug #81036: TCA l18n_parent is processed for sys_language_uid 0 New 2017-04-27


#1 Updated by Susanne Moog 2 months ago

  • Category set to FormEngine aka TCEforms

#2 Updated by SiteGef├╝hl no-lastname-given about 1 month ago

I can confirm the Problem in TYPO3 7 and PHP 7.1
We have something about 80.000 SQL queries after we clicked the edit button of the main record. It takes 3 minutes to open the record.
One identical query is executed something about 5000 times.

// Edit: Maybe this is going to fix the Problem? https://github.com/TYPO3/TYPO3.CMS/commit/f3e7a034c129aafc8b081e0125c50330207fae82#diff-ddfa1112aff05d23dcd52f1e19e04ba9
// If yes, I would be happy about a fix for Version 7

#3 Updated by Stefan Franke about 1 month ago

Unfortunately, commit f3e7a034c129aafc8b081e0125c50330207fae82 doesn't fix the issue for me.

It seems that it has got something to do with the localization. In my case I don't need the localization feature, so I got rid of it and that "solved" the problem.

#4 Updated by Andre Koller about 1 month ago

  • Related to Bug #81036: TCA l18n_parent is processed for sys_language_uid 0 added

#5 Updated by Andre Koller about 1 month ago

Typo3 v8.7.8 PHP 7.1

When "label_alt" and "label_alt_force" ist used in the ctrl-Section in TCA of the foreign model, 10000 sql queries executed.
Without label and label_alt_force 500 sql queries executed.

Can anyone confirm this?

Also available in: Atom PDF