[TYPO3-core] FYI24: Add feature #11708: Optimize database queries to session tables

Dmitry Dulepov dmitry.dulepov at gmail.com
Fri Aug 14 11:26:33 CEST 2009


Hi!

Oliver Hader wrote:
> Problem:
> Database queries to session tables will be performed each request when a
> frontend or backend user is logged in. To determine whether a session
> has expired in between always the "ses_tstamp" field is evalated with a
> proper index.
> 
> Solution:
> Define an index in the field ses_tstamp for the tables be_sessions and
> fe_session.

This is a single index but there are two fields in the query (+ a sorting field). Composite index can be better in this case, especially because both WHERE fields are integers. For example:

KEY x1 (ses_userid,ses_tstamp)

I would also experiment on a real data with:

KEY x1 (ses_userid,ses_tstamp,username(8))

Order of fields is important in these indexes.

-- 
Dmitry Dulepov
Facebook: http://www.facebook.com/dmitryd
Twitter: http://twitter.com/dmitryd
Skype: liels_bugs


More information about the TYPO3-team-core mailing list