Issue Bug Resolved

#110441Per-record translation lookup slows down Page and Records module drastically

Stephan Salzmann 08/11/26, 18:47 updated 09/02/26, 05:10

Description

Since v14.3.6 (#110281), `LocalizationRepository::getRecordTranslations()` matches translations with `(l10n_source = :uid OR (l10n_source = 0 AND l18n_parent = :uid))`. The second branch is unselective — `l10n_source = 0` applies to every untranslated record — so the lookup can no longer be resolved by a single index.

`DatabaseRecordList` and `GridColumnItem` call it once per rendered record for the delete confirmation hint, passing only the uid, so the method’s pid filter (`LocalizationRepository`) never applies and each call is unbounded across the whole table. On pages with many content elements the Page and Records modules take 20-60s longer than in v14.3.5 (approx 200000 enntries in tt_content). Both callers already hold the full record, which `getRecordTranslations()` accepts — passing it instead of the uid restores the pid restriction.

Reviews 4

History 617

  1. Benni Mack commented <span data-processor="relativetime" data-value="2026-08-13T16:43:12+00:00" > 08/13/26, 16:43 </span>

    Just the SQL queries from a live project

    Before – Shorter version

    Records Module

    SELECT * FROM pages WHERE l10n_source = 219164 AND sys_language_uid > 0 AND deleted=0....

    Page Module

    SELECT * FROM tt_content WHERE l10n_source = 219164 AND sys_language_uid > 0 AND deleted = 0...

    After – shorter version

    Records Module

    SELECT * FROM pages WHERE (l10n_source = 219164 OR (l10n_source = 0 AND l10n_parent = 219164)) AND sys_language_uid > 0 ...

    Page Module

    SELECT * FROM tt_content WHERE (l10n_source = 219164 OR (l10n_source = 0 AND l18n_parent = 219164)) AND sys_language_uid > 0 ...

    13.4.5 (before)

    Records Module

    SELECT * FROM pages WHERE l10n_source = 219164 AND sys_language_uid > 0 AND (((pages.deleted = 0) AND (((pages.t3ver_wsid = 0) AND (((pages.t3ver_oid = 0) OR (pages.t3ver_state = 4)))))))

    Page Module

    SELECT * FROM tt_content WHERE l10n_source = 219164 AND sys_language_uid > 0 AND (((tt_content.deleted = 0) AND (((tt_content.t3ver_wsid = 0) AND (((tt_content.t3ver_oid = 0) OR (tt_content.t3ver_state = 4))))))

    13.4.6 (after)

    Records Module

    SELECT * FROM pages WHERE ((l10n_source = 219164 OR ((l10n_source = 0 AND l10n_parent = 219164)))) AND sys_language_uid > 0 AND ((pages.deleted = 0 AND (((pages.t3ver_wsid = 0) AND ((pages.t3ver_oid = 0 OR pages.t3ver_state = 4))))))

    Page Module

    SELECT * FROM tt_content WHERE ((l10n_source = 219164 OR (l10n_source = 0 AND l18n_parent = 219164))) AND sys_language_uid > 0 AND ((tt_content.deleted = 0 AND ((tt_content.t3ver_wsid = 0 AND ((tt_content.t3ver_oid = 0 OR tt_content.t3ver_state = 4))))))
  2. Nikita Hovratov commented <span data-processor="relativetime" data-value="2026-08-24T10:21:46+00:00" > 08/24/26, 10:21 </span>

    I also have this problem in one of my v14 projects. After analyzing the MySQL queries, the problem is a FULL TABLE SCAN of ~100k tt_content records, which takes ~400ms. The problematic query is the “OR” condition, which prevents an index hit.

    (With the help of chatgpt) I found a performant query with the help of UNIONs:

    By splitting up the l10n_source part with uid x and with uid “0” we get an index hit for the existing translation indexes.
    Of course, this involves a little bit more rewrite and maybe the simple restriction to “pid” will already be enough, as this eliminates the majority of records beforehand, so the inefficient lookup is limited to a small subset of records.

    SELECT *
    FROM tt_content
    WHERE l10n_source = 117091
      AND sys_language_uid > 0
      AND deleted = 0
      AND t3ver_wsid = 0
      AND (t3ver_oid = 0 OR t3ver_state = 4)
    
    UNION ALL
    
    SELECT *
    FROM tt_content
    WHERE l10n_source = 0
      AND l18n_parent = 117091
      AND sys_language_uid > 0
      AND deleted = 0
      AND t3ver_wsid = 0
      AND (t3ver_oid = 0 OR t3ver_state = 4);
  3. Stefan Bürk commented <span data-processor="relativetime" data-value="2026-08-24T10:41:20+00:00" > 08/24/26, 10:41 </span>

    See #110454 95297: [BUGFIX] Cover translation lookup by a single index | https://review.typo3.org/c/Packages/TYPO3.CMS/+/95297

    Should improve this already a bit.

  4. Stephan Salzmann commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-02T05:10:11+00:00" > 09/02/26, 05:10 </span>

    Applied in changeset commit:9e7f9d1dc40fd284d7a1cd39711348f8218c605f.