diff --git a/typo3/sysext/core/ext_tables.sql b/typo3/sysext/core/ext_tables.sql
index a41feefabad9bf5eb954ae8be4bf0cc305c7601c..b845ddd88a7ad17782859dc8d9172395f7b984ae 100644
--- a/typo3/sysext/core/ext_tables.sql
+++ b/typo3/sysext/core/ext_tables.sql
@@ -271,7 +271,7 @@ CREATE TABLE sys_file_storage (
 	processingfolder tinytext,
 
 	PRIMARY KEY (uid),
-	KEY parent (pid)
+	KEY parent (pid,deleted)
 );
 
 #
@@ -316,8 +316,10 @@ CREATE TABLE sys_file (
 	alternative text,
 
 	PRIMARY KEY (uid),
-	KEY parent (pid),
-	KEY t3ver_oid (t3ver_oid,t3ver_wsid)
+	KEY parent (pid,deleted),
+	KEY t3ver_oid (t3ver_oid,t3ver_wsid),
+	KEY sel01 (storage,identifier(20)),
+	KEY sha1 (sha1(40))
 );
 
 #
@@ -392,9 +394,7 @@ CREATE TABLE sys_file_reference (
 	downloadname tinytext,
 
 	PRIMARY KEY (uid),
-	KEY uid_local (uid_local),
-	KEY uid_foreign (uid_foreign),
-	KEY parent (pid)
+	KEY parent (pid,deleted)
 );
 
 
@@ -438,7 +438,7 @@ CREATE TABLE sys_file_collection (
 	folder text NOT NULL,
 
 	PRIMARY KEY (uid),
-	KEY parent (pid),
+	KEY parent (pid,deleted),
 	KEY t3ver_oid (t3ver_oid,t3ver_wsid)
 );
 
@@ -477,7 +477,7 @@ CREATE TABLE sys_collection (
 	items int(11) DEFAULT '0' NOT NULL,
 
 	PRIMARY KEY (uid),
-	KEY parent (pid),
+	KEY parent (pid,deleted),
 	KEY t3ver_oid (t3ver_oid,t3ver_wsid)
 );
 
@@ -657,4 +657,4 @@ CREATE TABLE sys_category_record_mm (
 
 	KEY uid_local_foreign (uid_local,uid_foreign),
 	KEY uid_foreign_tablenames (uid_foreign,tablenames)
-);
\ No newline at end of file
+);