Skip to content

Commit

Permalink
[TASK] Improve check if records exist in DatabaseRecordList
Browse files Browse the repository at this point in the history
Limit the query to 1 row to check if there are records available
which improves the performance.

Resolves: #90419
Releases: master, 9.5
Change-Id: Ia965f906e4029698351e39501282242c480bb0d6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63296
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
  • Loading branch information
georgringer authored and ervaude committed Feb 20, 2020
1 parent fcecadb commit f1846b6
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3149,6 +3149,7 @@ public function generateList()
$queryBuilder = $this->addPageIdConstraint($tableName, $queryBuilder);
$firstRow = $queryBuilder->select('uid')
->from($tableName)
->setMaxResults(1)
->execute()
->fetch();
if (!is_array($firstRow)) {
Expand Down

0 comments on commit f1846b6

Please sign in to comment.