[TYPO3-core] RFC: improving index of sys_template

Dmitry Dulepov dmitry at typo3.org
Thu Oct 5 08:04:37 CEST 2006


Hi!

Martin Kutschker wrote:
> I suggest to change the index "parent" to KEY parent (pid,sorting). All 
> SELECTs that have a pid in the WHERE have also sorting in the ORDER BY.
> 
> As a test you may use this and have a look at output of EXPLAIN:
> 
> create index parent2 on sys_template (pid,sorting);
> EXPLAIn SELECT * FROM sys_template WHERE pid=1 AND deleted=0 AND 
> hidden=0 AND (starttime<=1157534861) AND (endtime=0 OR 
> endtime>1157534861) ORDER BY sorting LIMIT 1;
> 
> The point is that now the "Using filesort" is gone and another few 
> microseconds are saved by a tiny change of the code.

+1.

> It's probably a trunk only change.

I would +1 for 4.0 branch too. This is not a new feature (because it 
does not add new functionality). However up to you and Michael to decide...

-- 
Dmitry Dulepov

Web: http://typo3bloke.net/
Skype: callto:liels_bugs

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)



More information about the TYPO3-team-core mailing list