Performance problems - missing index on session_id column

Created on 21 October 2021, over 3 years ago
Updated 1 July 2025, 3 days ago

Here is a website with 3315447 records in recently_read table.
Page load time was 8000 ms on pages which contains recently read block.
A query like
SELECT * FROM recently_read WHERE session_id= 'xyz'
ran cca 2 sec.

I've indexed session_id column in recently_read table and the page load time decreased from 8000 ms to 800 ms and the query mentioned above ran 0,0003 sec instead of 2 sec so the performance problem is solved due to indexing.

It would be nice to modify the module to set up index to the session_id column on module install and for existing installs on the next update.

📌 Task
Status

Fixed

Version

1.1

Component

Code

Created by

🇭🇺Hungary kepesv

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024