Review main Merged

88387[TASK] Improve performance for fe_sessions with DB index

TYPO3com CR +2 V +2 Easy +1 −1 updated 04/08/25, 20:11

Commit message

Adapt the existing index to support the garbage collection
queries that partially use ses_tstamp and ses_userid.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1116

  1. TYPO3com uploaded patch set 1 02/27/25, 15:38

  2. core-ci voted on patch set 1 V +1 02/27/25, 15:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74840

  3. Garvin Hicking commented on patch set 1 02/27/25, 19:35

    Can you provide some more insight into the reasoning? Generally adding more indexes here can have an adverse effect on the writing performance of every new session, as also the indexes need to be updated then. So it could happen that while optimizing for one case (GC) it might impact the other case. Having the ability to reproduce the GC problems you might face would allow an informed decission on how to proceed here. Thanks a lot for sharing your patch!
  4. Benni Mack updated the commit message in patch set 2 V +1 04/08/25, 18:49

  5. core-ci voted on patch set 2 V +1 04/08/25, 18:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77226

  6. Christian Kuhn commented on patch set 2 04/08/25, 18:58

    Reply

    the affected queries are here: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php#L192 looking at the implementation, i think we should at least swap the index: tstamp first, userid second.
  7. Christian Kuhn uploaded patch set 3 V +1 04/08/25, 19:11

  8. Christian Kuhn updated the commit message in patch set 4 04/08/25, 19:11

  9. Stefan Bürk commented on patch set 4 04/08/25, 19:12

    Reply

    The old index should be extended with `ses_userid` as second index part, no need for two indexe which would leed to use both indexes and index merging vs using a compound index in the correct order.
  10. Christian Kuhn commented on patch set 4 04/08/25, 19:13

    Reply

    yeah. i just pushed this. this should be fine.
  11. core-ci voted on patch set 3 V +1 04/08/25, 19:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77228

  12. Stefan Bürk commented on patch set 4 CR +1 V +1 04/08/25, 19:20

    Reply

    Done
  13. core-ci voted on patch set 4 V +1 04/08/25, 19:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77229

  14. Christian Kuhn voted on patch set 4 CR +1 V +1 04/08/25, 19:29

  15. Stefan Bürk voted on patch set 4 CR +2 V +2 04/08/25, 20:00

  16. Stefan Bürk merged patch set 5 04/08/25, 20:11