Opening record in backend painfully slow with foreign table and large main table
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', ], ],