Skip to content

Commit badea39

Browse files
committed
MC-21737: MySql slow queries on url_rewrite
- Add composite index (entity_id,entity_type) to url_rewrite table
1 parent d271281 commit badea39

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/code/Magento/UrlRewrite/etc/db_schema.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,8 @@
3737
<column name="store_id"/>
3838
<column name="entity_id"/>
3939
</index>
40+
<index referenceId="URL_REWRITE_ENTITY_ID" indexType="btree">
41+
<column name="entity_id"/>
42+
</index>
4043
</table>
4144
</schema>

app/code/Magento/UrlRewrite/etc/db_schema_whitelist.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
},
1515
"index": {
1616
"URL_REWRITE_TARGET_PATH": true,
17-
"URL_REWRITE_STORE_ID_ENTITY_ID": true
17+
"URL_REWRITE_STORE_ID_ENTITY_ID": true,
18+
"URL_REWRITE_ENTITY_ID": true
1819
},
1920
"constraint": {
2021
"PRIMARY": true,
2122
"URL_REWRITE_REQUEST_PATH_STORE_ID": true
2223
}
2324
}
24-
}
25+
}

0 commit comments

Comments
 (0)