Issue Task Under Review

#111414Find the descendant pages in the frontend with one database query

Benni Mack 11/11/26, 15:36 updated 11/19/26, 08:45

Description

PageRepository::getDescendantPageIdsRecursive() and getPageIdsRecursive() walk the page tree with one query per page, plus a workspace overlay per page in a workspace. They are used by menus (HMENU), content objects with “recursive”, Extbase storage pids in the frontend, felogin, the XML sitemaps of EXT:seo and the indexed search.

For 780 pages below a page, this results in 783 queries, and about twice as many in a workspace.

The pages of all levels can be fetched with one query by the PageDescendantsRepository (#111406), resolved for the workspace of the context. The decisions about the pages stay as they are and are evaluated in PHP: enable fields and group access via RecordAccessVoter (including the RecordAccessGrantedEvent), “extendToSubpages”, backend user sections, excluded pages, mount points in both modes, and the level to start collecting. The pages below a mount point are fetched with one further query per mount point.

The result is the same, the number of queries no longer depends on the number of pages: for 780 pages, 3 instead of 783 queries are needed.

Reviews 1

History 03