Project

General

Profile

Actions

Task #90419

closed

Improve performance of DatabaseRecordList->generateList()

Added by Robert Heinig almost 5 years ago. Updated over 4 years ago.

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

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

When checking if there are any rows to render, a DB query fetches the uids of all records instead of only one. This leads to perceptible bad performance of the backend list view with >100k rows.

File in current master:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

Current:

$firstRow = $queryBuilder->select('uid')
                    ->from($tableName)
                    ->execute()
                    ->fetch();

Could be:

$firstRow = $queryBuilder->select('uid')
                    ->from($tableName)
                    ->setMaxResults(1)
                    ->execute()
                    ->fetch();

This behavior exists at least since TYPO3 8.
Backports to version 9 and 8 are similarly easy changes, but e.g. the code for TYPO3 8 recides in AbstractDatabaseRecordList.

Actions #1

Updated by Georg Ringer almost 5 years ago

hey!

thanks for creating the issue! what about using a real count query instead? $firstRow is never used anyway?

Actions #2

Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63316

Actions #3

Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63316

Actions #4

Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63296

Actions #5

Updated by Georg Ringer almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF