Task #64091
closedLinkvalidator: only select rows that have content in at least one of the relevant fields
0%
Description
Optimize the SQL query in LinkAnalyzer to only fetch records whose fields are not empty.
Updated by Tymoteusz Motylewski over 4 years ago
What should be taken into account here is that
$this->analyzeRecord($results, $table, $fields, $row);
calls a hook:
return $this->getSignalSlotDispatcher()->dispatch(
self::class,
'beforeAnalyzeRecord',
[$results, $record, $table, $fields, $this]
);
where record has only configured fields.
for tt_content it's
0 = "bodytext"
1 = "header_link"
2 = "records"
3 = "pi_flexform"
The problem is that it doesn't allow extensions to limit record they want to analyze. adding ctype and so would help, but we don't want ctype to be analyzed by linvalidator, we just need it as a context.
SO I would suggest to:
- select * instead of
$selectFields = array_merge(['uid', 'pid', $GLOBALS['TCA'][$table]['ctrl']['label']], $fields);
as analyzeRecord already gets a $fields param which specify which fields should be analyzed.
This way hooks in extensions can get enough context not to process too much - see https://forge.typo3.org/issues/90592