Review main Merged

90562[TASK] Avoid costly database schema queries and class state

Stefan Bürk CR +2 V +2 Normal +25 −33 updated 09/06/25, 11:52

Commit message

Some places in our code base need to deal with database schema
information, which are quite costly doing them over and over again.

This change streamlines occurrences to use the internal cached
schema information (`Connection->getSchemaInformation()`) to
replace the occurrences and centralizing them to one place. With
that, instance state can be removed in two cases and in one case
the uncached usage replaced by the cached schema information.

`SchemaInformation->listTableColumns()` is added to mimic the
`AbstractSchemaManager->listTableColumns()` method and return
same structure `array<string, Column>` instead of `Column[]`,
considerable not a feature and doable as task because the
complete class is marked as `@internal`.

Note that `SchemaInformation` uses only a code cache right now
and will get a second level (`runtime`) cache in a dedicated
change eliminating the need to read it from PHP files over and
over again.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Stefan Froemken +1
    • Benni Mack +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Stefan Froemken +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1927

Show 2 earlier messages
  1. Stefan Bürk uploaded patch set 1 09/04/25, 10:25

  2. Stefan Bürk updated the commit message in patch set 2 09/04/25, 10:25

  1. core-ci voted on patch set 1 V -1 09/04/25, 10:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84366

  2. core-ci voted on patch set 2 V -1 09/04/25, 10:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84367

  3. Stefan Bürk marked it work in progress 09/04/25, 10:43

  4. Stefan Bürk uploaded patch set 3 V -1 09/04/25, 11:01

  5. core-ci voted on patch set 3 V +1 09/04/25, 11:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84368

  6. Stefan Bürk marked it ready for review 09/04/25, 11:14

  7. Stefan Bürk updated the commit message in patch set 4 V +1 09/04/25, 11:15

  8. core-ci voted on patch set 4 V +1 09/04/25, 11:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84370

  9. Andreas Kienast commented on patch set 4 09/04/25, 11:26

    MetaDataRepositoryTest.php:28

    I assume this is a left-over?
  10. Stefan Bürk uploaded patch set 5 V +1 09/04/25, 12:36

  11. Stefan Bürk commented on patch set 5 09/04/25, 12:40

    MetaDataRepositoryTest.php:28 Reply

    Correct assumption. Removed.
  12. core-ci voted on patch set 5 V +1 09/04/25, 12:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84372

  13. Markus Klein updated the commit message in patch set 6 V +1 09/04/25, 13:02

  14. core-ci voted on patch set 6 V +1 09/04/25, 13:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84380

  15. Stefan Bürk uploaded patch set 7 09/04/25, 18:38

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  16. core-ci voted on patch set 7 V +1 09/04/25, 18:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84393

  17. Benni Mack voted on patch set 7 CR +1 V +1 09/05/25, 06:57

  18. Stefan Bürk updated the commit message in patch set 8 CR +1 V +1 09/05/25, 07:35

  19. Benni Mack voted on patch set 8 CR +1 V +1 09/05/25, 07:38

  20. core-ci voted on patch set 8 V +1 09/05/25, 07:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84432

  21. Stefan Froemken commented on patch set 8 09/05/25, 08:23

    SchemaInformation.php:77

    For those who are searching for the cache usage: It's here, within "introspectSchema": $schema = $this->connection->createSchemaManager()->introspectSchema(); $this->cache->set($identifier, $schema);
  22. Stefan Froemken commented on patch set 8 CR +1 V +1 09/05/25, 08:33

    SchemaInformation.php:79

    I wondered about all these getName() calls as the column-name is already stored as array-key within Table->_columns, but Doctrines getColums() does an array_value before, that's why we (you) had to extract this information again. Njag...OK.
  23. Stefan Bürk voted on patch set 8 CR +2 V +2 09/05/25, 08:43

  24. Stefan Bürk merged patch set 9 09/05/25, 08:43

  25. Stefan Bürk wrote 09/06/25, 11:52

    Created a revert of this change as I6da8b5e54b0e178fc2680e9335bfd6e9cbf64620