Review main Work in progress

97552[TASK] Restrict queries to a page tree without a list of page ids

Benni Mack CR 0 V 0 Hard +410 −107 updated 11/19/26, 08:57

Commit message

The record list with search levels, the log module with a depth
and the recycler collected the uids of all pages of a page tree
and added them to their queries as "pid IN (...)". With large page
trees, this list made the queries slow and exceeded the number of
placeholders a database accepts in one statement.

PageDescendantsRepository::createPageTreeConstraint() returns a
constraint for a field holding a page uid, which resolves the page
tree within the query as a subquery with a recursive common table
expression. If the queried table lives on another connection than
the pages table, it falls back to a list of uids.

For 780 pages, the record list and the log module needed 2 queries
in live and 5 queries in a workspace to fetch the page tree before
their actual query, which then carried 781 parameters. The recycler
fetched the page tree once per request and repeated the uid list
in the query of each table. Now no additional query is needed, and
the queries carry no uid list.

The record list now searches the page tree of the workspace of the
backend user, so records on pages new in the workspace are found.

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 3
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/52/97552/3 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/52/97552/3 && git cherry-pick FETCH_HEAD

Review

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

Relation chain 4

  1. main 97560[TASK] Find subpages with one query when copying and deleting pages Based on this change Work in progress Merge conflict Benni Mack CR 0 V -1 Hard +494 −186
  2. main 97553[TASK] Find the descendant pages in the frontend with one query Based on this change Work in progress Benni Mack CR 0 V 0 Normal +181 −39
  3. 97552 [TASK] Restrict queries to a page tree without a list of page ids This change

  4. main 97537[FEATURE] Find the subpages of a page with one database query This change is based on it Merged Benni Mack CR +2 V +2 Expert +1804 −659

    The chain has patch set 6 of 7, the changes above it need a rebase.

Merge conflicts 23

Issues 3

Files 10

Review log 36

  1. Benni Mack uploaded patch set 1 11/11/26, 15:58

  2. core-ci voted on patch set 1 V +1 11/11/26, 16:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114117

  3. Benni Mack rebased onto patch set 2 V +1 11/15/26, 08:27

  4. core-ci voted on patch set 2 V -1 11/15/26, 08:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114514

  5. Benni Mack uploaded patch set 3 V -1 11/19/26, 08:45

  6. core-ci voted on patch set 3 V +1 11/19/26, 08:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114977