[TYPO3-core] FYI72: Feature 9289: Missing index for deleting outdated session data in fe_session_data

Christian Kuhn lolli at schwarzbu.ch
Tue Mar 23 00:45:52 CET 2010


Attached patch will be committed in 72 hours if nobody complains.

Type: Feature / Performance improvement / nearly no-brainer

Branches: trunk

BT: http://bugs.typo3.org/view.php?id=9289

Problem:
On every 100th FE access (in the middle) a garbage collection for table 
fe_session_data is executed with a query like "DELETE FROM 
fe_session_data WHERE tstamp < too old". As this table can have lots of 
records, the query might be pretty slow because of a missing key on 
tstamp field.

Solution:
Add key on tstamp field

Notes:
My numbers for a table with 30k records on a pretty well optimized mysqld:
- 30 ms without key
- <1 ms with key
Numbers will be much more impressive for less optimized or bigger 
tables, the issue reporter talked about 1300 ms for his query without key.

Regards
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9289_01.diff
Type: text/x-patch
Size: 433 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100323/4d0f9952/attachment.bin>


More information about the TYPO3-team-core mailing list