#101121Poor performance with INLINE + children having "label_alt" being set to a relation (n:1) column
Description
I’ve noticed massive performance issues with INLINE relations when childrens have “label_alt” set to fields which are relations (n:1) themselves. Current scenario is:
- There are 400 “seminars”, 4.000 “events”, 20 “locations”.
- Database layout is “seminars” 1:n> “event” <n:1> “location.</n:1>
- TCA form for “seminar” contains “events” defined as INLINE, and “event” contains “location” as SELECT SINGLE.
- Table “event” has “label_alt => date, location, seminar” set (last two are n:1 relations).
Now opening the backend edit form for a “seminar” (which contains ~ 100 inline “events”) leads to a never ending request on live system (“gateway timeout” on DDEV local). On database level, nothing could be improved by setting additional indices for all relationál columns. As soon as “label_alt” is removed, there are no performance issues. In addition, this only happens when used within an INLINE relation. In plain list view for “event”, this “label_alt” setting containing relations doesn’t cause any problems.
I stumbled across this issue several times in the past. As far as is remember it always happens when “label_alt” refers to relations in combination with INLINE usage. I suppose the database queries in behind are not really good and perhaps they simply deal wrong with relations or don’t use plain left joins (“event” <n:1> “location”).</n:1>
The only way i could work around this was, to use a custom label user function for the “event” label, which does “BackendUtility::getRecord()” for “location” and “seminar” in behind. So the 100 inline records themselves are not the problem and in general, we are not talking about a huge amount of records at all.
Reviews 1
History 08
-
Gerrit Code Review pushed patch set 1 for main to change 81871 status
NewUnder Review <span data-processor="relativetime" data-value="2023-11-22T19:29:08+00:00" > 11/22/23, 19:29 </span> -
Gerrit Code Review pushed patch set 2 for main to change 81871 <span data-processor="relativetime" data-value="2023-11-22T19:30:08+00:00" > 11/22/23, 19:30 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 81871 <span data-processor="relativetime" data-value="2023-11-23T12:37:26+00:00" > 11/23/23, 12:37 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 81871 <span data-processor="relativetime" data-value="2023-11-23T13:22:23+00:00" > 11/23/23, 13:22 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 81871 <span data-processor="relativetime" data-value="2024-05-28T20:47:31+00:00" > 05/28/24, 20:47 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 81871 <span data-processor="relativetime" data-value="2024-05-29T04:52:30+00:00" > 05/29/24, 04:52 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 81871 <span data-processor="relativetime" data-value="2024-07-12T17:30:11+00:00" > 07/12/24, 17:30 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 81871 <span data-processor="relativetime" data-value="2024-07-12T17:43:13+00:00" > 07/12/24, 17:43 </span>