Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Stale

95611[TASK] Resolve recursive storage pids with a recursive CTE

Stefan Bürk CR 0 V 0 Hard +359 −41 updated 09/03/26, 18:03

Commit message

Extbase resolves recursive backend storage pids with one
query per visited page. Large page trees therefore cause
thousands of database round trips.

Replace the PHP recursion with a single recursive common
table expression (CTE) using the QueryBuilder CTE API that
is also used by RootlineUtility. Only the start pages are
bound as query parameters, the recursion itself happens in
the database and stops at the configured level. The database
returns the parent relation of the sub pages, the existing
depth-first order with siblings sorted by uid is rebuilt
from it in PHP. Sorting on a path column built up in the CTE
is no option, MariaDB compares only the first max_sort_length
bytes of a value when sorting.

Deleted pages, page translations and pages the backend user
may not see are skipped with their sub pages as before, and
overlapping start pages are still expanded with their own
depth each. The only behavioural change is a hard cap of the
recursion at 100 levels including the start page.

Functional tests pin the existing behaviour for admin and
non-admin users, including permissions, deleted pages,
ordering, the depth cap and edge cases, and run against all
supported database vendors.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 1
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/11/95611/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/11/95611/1 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Files 4

Review log 12

  1. Stefan Bürk uploaded patch set 1 09/03/26, 17:55

  2. core-ci voted on patch set 1 V +1 09/03/26, 18:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107768