Review 14.3 Merged

97543[BUGFIX] Cache rows of GreedyDatabaseBackend per pid

Benni Mack CR +2 V +2 Hard +253 −37 updated 11/11/26, 14:05

Commit message

GreedyDatabaseBackend fetches all records on the pids of the requested
uids in one query and points each uid to that cached result set. When
a later request combined uids from several pids, the first uid with a
pointer decided which result set was returned. Relations to records on
other pids - such as a "teaser list" content element pointing to pages
all over the page tree - silently lost every record that was not part
of that set.

The runtime cache now holds one complete set of rows per pid, plus a
lightweight pointer per uid to the pid its row has been found on. Uids
without an accessible row in the current context point to "false", so
they do not trigger the same database query over and over again.

A request is answered by collecting the rows of all pids its uids
point to, no matter how the uids are combined. Only uids that can not
be answered from the cache are queried, and the rows of their pids are
added to the cache. Rows that are already cached are neither queried
nor stored twice, so many records sharing a pid keep the memory
footprint as small as before.

The rows are returned in the order of the requested uids. The only
consumer, RelationResolver, sorts them by uid on its own, so this has
no effect on the resolved relations.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 2

Review log 34

  1. Benni Mack commented on patch set 1 11/11/26, 13:48

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 11/11/26, 14:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114090

  3. Benni Mack voted on patch set 1 CR +2 V +2 11/11/26, 14:05

  4. Benni Mack merged patch set 2 11/11/26, 14:05