Bug #19287

missing index for deleting outdated session data in fe_session_data

Added by Sebastian Mendel about 13 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-09-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

9289_01.diff (433 Bytes) 9289_01.diff Administrator Admin, 2010-03-23 00:21

Related issues

Related to TYPO3 Core - Feature #20877: Optimize database queries to session tablesClosedOliver Hader2009-08-13

Actions
Has duplicate TYPO3 Core - Bug #21716: TYPO3 randomly needs up to 1 minute to answer requests (includes bugfix)Closed2009-11-27

Actions
#1

Updated by Saverio Vigni almost 13 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.

#2

Updated by Christian Kuhn over 11 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.

#3

Updated by Christian Kuhn over 11 years ago

Committed to trunk rev. 7155

Also available in: Atom PDF