[TASK] Adapt indexes of sys_file_reference 26/26626/7
authorIngo Schmitt <is@marketing-factory.de>
Fri, 3 Jan 2014 15:18:43 +0000 (16:18 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Wed, 8 Jan 2014 09:43:51 +0000 (10:43 +0100)
The backend and frontend fire several queries for referenced
files - files with metadata overlay as used in tt_content for
images and media field as well as in pages:media.
Analysing the queries for that some indexed should be added
to improve the query speed on large installations.

This patch adds indexed for the table/fieldname combination
as well es the uid of the record the file is attached to.

Resolves: #54725
Releases: 6.2
Change-Id: I229e27e382e8d0fdaf9bbc0b6729f90dac019e19
Reviewed-on: https://review.typo3.org/26626
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/core/ext_tables.sql

index f6c4185..e46c7a0 100644 (file)
@@ -425,7 +425,10 @@ CREATE TABLE sys_file_reference (
        downloadname tinytext,
 
        PRIMARY KEY (uid),
-       KEY parent (pid,deleted)
+       KEY parent (pid,deleted),
+       KEY tablenames_fieldname (tablenames(32),fieldname(12)),
+       KEY deleted (deleted),
+       KEY uid_foreign (uid_foreign)
 );