#110441Per-record translation lookup slows down Page and Records module drastically
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
Related issues 2
History 617
-
Gerrit Code Review pushed patch set 1 for main to change 95271 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-11T18:48:09+00:00" > 08/11/26, 18:48 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95271 <span data-processor="relativetime" data-value="2026-08-11T20:34:40+00:00" > 08/11/26, 20:34 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95271 <span data-processor="relativetime" data-value="2026-08-11T20:35:20+00:00" > 08/11/26, 20:35 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 95271 <span data-processor="relativetime" data-value="2026-08-12T05:44:32+00:00" > 08/12/26, 05:44 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 95271 <span data-processor="relativetime" data-value="2026-08-12T06:04:57+00:00" > 08/12/26, 06:04 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95274 <span data-processor="relativetime" data-value="2026-08-12T06:04:58+00:00" > 08/12/26, 06:04 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 95271 <span data-processor="relativetime" data-value="2026-08-13T13:37:55+00:00" > 08/13/26, 13:37 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 95271 <span data-processor="relativetime" data-value="2026-08-13T19:02:18+00:00" > 08/13/26, 19:02 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 95271 <span data-processor="relativetime" data-value="2026-08-14T11:50:15+00:00" > 08/14/26, 11:50 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 95271 <span data-processor="relativetime" data-value="2026-08-14T18:26:15+00:00" > 08/14/26, 18:26 </span>
-
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);
-
Nikita Hovratov changed Related to #110281 <span data-processor="relativetime" data-value="2026-08-24T10:25:09+00:00" > 08/24/26, 10:25 </span>
-
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.
-
Nikita Hovratov changed Related to #110454 <span data-processor="relativetime" data-value="2026-08-24T11:10:00+00:00" > 08/24/26, 11:10 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95540 <span data-processor="relativetime" data-value="2026-09-02T05:06:05+00:00" > 09/02/26, 05:06 </span>
-
Stephan Salzmann commented and changed status
Under ReviewResolved done0 %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.
Just the SQL queries from a live project
Before – Shorter version
Records Module
Page Module
After – shorter version
Records Module
Page Module
13.4.5 (before)
Records Module
Page Module
13.4.6 (after)
Records Module
Page Module