Bug #19287
closedmissing index for deleting outdated session data in fe_session_data
0%
Description
in class.tslib_feuserrauth.php:fetchSessionData() is a query to delete outdated data, with a WHERE condition on `tstamp` which has no index - at least for the system i am observing right now - this takes 1.3 seconds on average (executed 10k times on 24h) - way too long
is there any reason why there is no index on `tstamp`?
(issue imported from #M9289)
Files
Updated by Saverio Vigni almost 16 years ago
I've found the same problem while trying to optimize the performance of a new website i'm working on, fe_session_data was getting quite large ( > 20000 records) and the start of the garbage collector was causing a major load on the mysqld process.
Setting an index to the timestamp field brought back the load to more resonable levels, for the moment everything seems working fine, but i would suggest to add that index, i don't know any reason why isn't there.
Updated by Christian Kuhn over 14 years ago
Good catch! Attached a trivial patch do add a key on tstamp field of fe_session_data.
My numbers: 32ms to execute query without key, <1ms with key, but my db is already pretty well optimized.