Project

General

Profile

Actions

Bug #99840

closed

Remove `media` from rootlineFields

Added by Julian Hofmann almost 2 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
-
Start date:
2023-02-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Column `media` is one of the predefined values in RootlineUtility (https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/8.7.x/Important-84144-RootlineUtilityIsEnrichingOnlyProperlySelectedRelationalDatabaseFields.html).

During menu generation, this causes an attempt to resolve the relation for each menu item, i.e. at least one SQL query. Even if the field is not used at all by a website. A not inconsiderable (but useless) additional effort when creating large (mega) menus.

We should find a way to disable this value in RootlineUtility or make it configurable.

A workaround seems a: `unset($GLOBALS['TCA']['pages']['columns']['media']);`

Actions #1

Updated by Nikita Hovratov almost 2 years ago

  • Subject changed from Remove `media`from rootlineFields to Remove `media` from rootlineFields

I think it is included by default because of TypoScript stdWrap "levelmedia". But yes, it should definitely be configurable, if not used at all. Another possibility could be to check for "0" values and skip resolving, but this needs a more general approach for all kind of relations. I don't know if this would work.

Actions #2

Updated by Julian Hofmann almost 2 years ago

Sure, `levelmedia` won't actually work without the media-relation. Maybe, it is worth a thought to define `media` as default in `addRootlineFields`. This way, it could normally be resolved, but optionally you can remove it.

(Maybe, it's even worth a thought to deprecate `leveluid` and `levelmedia` as both could be replaced by `levelfield`)

Actions #3

Updated by Christoph Lehmann about 1 year ago

  • Category set to Performance

The check for '0' would prevent that query.

I already tried to prevent this superfluous SQL query in FilesProcessor, but the patch was not accepted, see https://review.typo3.org/c/Packages/TYPO3.CMS/+/76820/2#message-1ef3caaf5441888dea4b4b31b6220290b651f75a for details.

Thus, removing 'media' from default rootline fields would solve it.

Actions #4

Updated by Benni Mack 5 months ago

  • Status changed from New to Closed

Hey,

this has been fixed in the upcoming 13.2 with a massive performance boost using CTEs (Common Table Expressions). Will close this issue for this reason.

Actions

Also available in: Atom PDF