#109561Add index for pages.content_from_pid
Description
Hello everybody,
we have a large multisite installation of TYPO3 running and we were wondering why the backend editing got really slow. After a short analysis we found out, that PageLayoutController::getPageLinksWhereContentIsAlsoShownOn is querying the pages table with a filter for the content_from_pid column. As we have around 660.000 enabled pages within the installation, the query was quite slow with an index on that column (as 660K records had to be scanned on each request of the content element overview of a page).
We simply added a index like the following to the pages table and the request duration to the content element overview pages dropped by 66%.
CREATE TABLE pages (
KEY `content_from_pid` (`content_from_pid`),
);Reviews 2
History 35
-
Gerrit Code Review pushed patch set 1 for main to change 93637 status
NewUnder Review 04/13/26, 10:33 -
Christian Kuhn commented 04/13/26, 11:07
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 93638 04/13/26, 11:10
-
Ravi Sachaniya commented and changed status
Under ReviewResolved done0 %100 % 04/13/26, 11:35Applied in changeset commit:65088c513e30f584afa6b002771ffffa164298e8.
-
Benni Mack changed status
ResolvedClosed 04/21/26, 11:30
yeah. considering the fact this query is fired often in regular BE calls, and such an index does not hurt (much), i’m fine.