#107530Performance: Reduce calls to quoteIdentifiersForSelect
Description
Hi,
when working with workspaces each record will be processed by PageRepository::versionOL(). This needs around 0,0028 – 0,0034 seconds. Unforgenably, unfor…, damn unfortunately “purgeComputedProperties” uses array_keys of $row instead of “*”:
// implode(',',array_keys($row)) = Using fields from original record to make
// sure no additional fields are selected. This is best for eg. getPageOverlay()
// Computed properties are excluded since those would lead to SQL errors.
$fields = array_keys($this->purgeComputedProperties($row));
That results into a lot of QueryBuilder::quoteIdentifier() calls. With extended pages-records the amount of column can increase up to 80 or more. With 2000 calls to versionOL we got 160.000 calls to quoteIdentifier.
I debugged that with XHGUI:
TYPO3\CMS\Core\Database\Query\QueryBuilder::quoteIdentifiersForSe… count self inc. 7823 303,724 µs 1,593,437 µs
I have implemented a cache for that, which reduzes the wall time to 95ms
Reviews 2
History 34
-
Gerrit Code Review pushed patch set 1 for main to change 90785 status
NewUnder Review 09/24/25, 10:03 -
Oliver Hader changed target version 01/23/26, 12:29
-
Benni Mack changed target version 03/31/26, 09:05
-
Georg Ringer commented and changed status
Under ReviewClosed 04/17/26, 19:53
imo solved