Review main Merged

91237[TASK] Make GreedyDatabaseBackend more sophisticated

Nikita Hovratov CR +2 V +2 Normal +107 −61 updated 03/11/26, 19:07

Commit message

This patch improves GreedyDatabaseBackend, so that it
doesn't store the same database rows all over again.
This is done by remembering the uids of the result
rows and pointing them to the actual cache identifier.
The next time a uid from the last result is requested,
the pointer will be retrieved and with it the rows itself.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Garvin Hicking +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2431

Show 36 earlier messages
  1. Nikita Hovratov uploaded patch set 1 10/24/25, 10:33

  2. Nikita Hovratov uploaded patch set 2 10/24/25, 10:35

  3. core-ci voted on patch set 1 V -1 10/24/25, 10:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87485

  4. core-ci voted on patch set 2 V +1 10/24/25, 10:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87486

  5. Nikita Hovratov uploaded patch set 3 V +1 12/09/25, 17:54

  6. core-ci voted on patch set 3 V -1 12/09/25, 18:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91923

  1. Nikita Hovratov uploaded patch set 4 V -1 12/09/25, 19:41

  2. core-ci voted on patch set 4 V +1 12/09/25, 19:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91929

  3. Tobias Gaertner commented on patch set 4 V +1 12/10/25, 08:23

    I tested the patch and it solves a huge performance issue we faced with nested object structure in content-blocks.
  4. Nikita Hovratov rebased onto patch set 5 V +1 02/27/26, 17:19

  5. core-ci voted on patch set 5 V +1 02/27/26, 17:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96985

  6. Nikita Hovratov rebased onto patch set 6 V +1 03/10/26, 07:46

  7. core-ci voted on patch set 6 V +1 03/10/26, 08:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97653

  8. Georg Ringer voted on patch set 6 CR +1 V +1 03/11/26, 09:18

  9. Simon Schaufelberger voted on patch set 6 CR +1 V +1 03/11/26, 11:14

  10. Simon Schaufelberger commented on patch set 6 CR 0 V 0 03/11/26, 11:19

    GreedyDatabaseBackend.php:105

    just by reading I don't really understand what is going on and what "pointer" here means. Can this be explained as there are 2 different kind of identifiers used.

    GreedyDatabaseBackend.php:168

    return can be inlined
  11. Georg Ringer commented on patch set 6 CR 0 V -1 03/11/26, 11:35

    GreedyDatabaseBackend.php:108

    getting in backend preg_match(): Argument #2 ($subject) must be of type string, array given in line 111 (v13): if ($this->runtimeCache->has($cacheIdentifier)) {
  12. Nikita Hovratov commented on patch set 6 03/11/26, 11:36

    GreedyDatabaseBackend.php:105 Reply

    "cache-identifier-pointer-1" => "cache-identifier-1" "cache-identifier-pointer-2" => "cache-identifier-1" "cache-identifier-pointer-3" => "cache-identifier-2" "cache-identifier-pointer-4" => "cache-identifier-2" "cache-identifier-1" => array<DB Row> "cache-identifier-2" => array<DB Row 2>

    GreedyDatabaseBackend.php:168 Reply

    I don't like to inline such things for debugging purposes.
  13. Nikita Hovratov commented on patch set 6 03/11/26, 11:38

    GreedyDatabaseBackend.php:108 Reply

    Can you debug, what's inside $cacheIdentifier? This should be always a string.
  14. Nikita Hovratov commented on patch set 6 03/11/26, 11:43

    GreedyDatabaseBackend.php:105 Reply

    This is the main change here. So instead of caching the db rows for each new uid, we cache the pointer to that identifier.
  15. Georg Ringer commented on patch set 6 CR +1 V +1 03/11/26, 11:55

    it was my fault, sry :(
  16. Simon Schaufelberger commented on patch set 6 03/11/26, 11:57

    GreedyDatabaseBackend.php:105 Reply

    please add a doc header comment that explains a bit what is going on.

    GreedyDatabaseBackend.php:168 Reply

    xdebug supports debugging return types since long time now.
  17. Nikita Hovratov commented on patch set 6 03/11/26, 12:42

    GreedyDatabaseBackend.php:105 Reply

    I can add one, np.

    GreedyDatabaseBackend.php:168 Reply

    I know, it's just a preference. As there is no code guideline enforcing this, I would like to keep it.
  18. Nikita Hovratov uploaded patch set 7 CR +1 V +1 03/11/26, 13:44

  19. Nikita Hovratov commented on patch set 7 03/11/26, 13:45

    GreedyDatabaseBackend.php:105 Reply

    Done
  20. Nikita Hovratov commented on patch set 7 03/11/26, 13:45

    GreedyDatabaseBackend.php:108 Reply

    Done
  21. core-ci voted on patch set 7 V +1 03/11/26, 14:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97762

  22. Simon Schaufelberger commented on patch set 7 CR +1 03/11/26, 14:51

    GreedyDatabaseBackend.php:168 Reply

    Done
  23. Garvin Hicking voted on patch set 7 CR +1 V +1 03/11/26, 16:47

  24. Anja Leichsenring voted on patch set 7 CR +2 V +2 03/11/26, 19:07

  25. Anja Leichsenring merged patch set 8 03/11/26, 19:07