[TYPO3-core] RFC: improving index of sys_template
Martin Kutschker
Martin.Kutschker at n0spam-blackbox.net
Wed Oct 4 17:55:16 CEST 2006
Hi!
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.
It probably makes sense to change other "parent" indices of tables with
sorting columns as well (eg pages and tt_content), but I haven't
investigated closely.
It's probably a trunk only change.
Masi
More information about the TYPO3-team-core
mailing list