[BUGFIX] Optimize index of some database tables
authorDmitry Dulepov <dmitry@typo3.org>
Sun, 14 Aug 2011 13:32:07 +0000 (15:32 +0200)
committerXavier Perseguers <xavier@typo3.org>
Wed, 17 Aug 2011 06:32:18 +0000 (08:32 +0200)
Some database indexes in TYPO3 tables are not optimal:
they include the sorting field in the wrong position.
MySQL will not use such index for sorting (sorting
field must always be in the end of index).

Change-Id: I9d900013ac5cabb7bdd7130ff2502674ee2c9b2a
Resolves: #21381
Reviewed-on: http://review.typo3.org/4317
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Mario Rimann
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/stddb/tables.sql
typo3/sysext/cms/ext_tables.sql

index 5451524..9dd81e8 100644 (file)
@@ -177,7 +177,7 @@ CREATE TABLE pages (
   backend_layout_next_level int(10) DEFAULT '0' NOT NULL,
   PRIMARY KEY (uid),
   KEY t3ver_oid (t3ver_oid,t3ver_wsid),
-  KEY parent (pid,sorting,deleted,hidden),
+  KEY parent (pid,deleted,hidden,sorting),
   KEY alias (alias)
 );
 
index eff712d..3d825af 100755 (executable)
@@ -255,7 +255,7 @@ CREATE TABLE sys_template (
   tx_impexp_origuid int(11) DEFAULT '0' NOT NULL,
   PRIMARY KEY (uid),
   KEY t3ver_oid (t3ver_oid,t3ver_wsid),
-  KEY parent (pid,sorting,deleted,hidden)
+  KEY parent (pid,deleted,hidden,sorting)
 );