Skip to content

Commit

Permalink
MDEE-596: Missed index causes FILE SORT and query slowness (#350)
Browse files Browse the repository at this point in the history
* MDEE-596: Missed index causes FILE SORT and query slowness
  • Loading branch information
le0n4ik authored Oct 31, 2023
1 parent d630c28 commit 00e1a84
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CatalogDataExporter/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
<column name="modified_at"/>
<column name="id"/>
</index>
<index referenceId="catalog_data_exporter_products_modified_at_status" indexType="btree">
<column name="modified_at"/>
<column name="status"/>
</index>
</table>

<table name="catalog_data_exporter_categories" resource="default" engine="innodb" comment="Category Feed Storage">
Expand Down
3 changes: 2 additions & 1 deletion CatalogDataExporter/etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"catalog_data_exporter_products": {
"index": {
"CATALOG_DATA_EXPORTER_PRODUCTS_MODIFIED_AT": true
"CATALOG_DATA_EXPORTER_PRODUCTS_MODIFIED_AT": true,
"CATALOG_DATA_EXPORTER_PRODUCTS_MODIFIED_AT_STATUS": true
},
"constraint": {
"PRIMARY": true
Expand Down
4 changes: 4 additions & 0 deletions ProductPriceDataExporter/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@
<column name="modified_at"/>
<column name="product_id"/>
</index>
<index referenceId="catalog_data_exporter_product_prices_modified_at_status" indexType="btree">
<column name="modified_at"/>
<column name="status"/>
</index>
</table>
</schema>
3 changes: 2 additions & 1 deletion ProductPriceDataExporter/etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"catalog_data_exporter_product_prices": {
"index": {
"CATALOG_DATA_EXPORTER_PRODUCT_PRICES_MODIFIED_AT": true
"CATALOG_DATA_EXPORTER_PRODUCT_PRICES_MODIFIED_AT": true,
"CATALOG_DATA_EXPORTER_PRODUCT_PRICES_MODIFIED_AT_STATUS": true
},
"constraint": {
"PRIMARY": true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"catalog_data_exporter_products": {
"constraint": [
"PRIMARY"
],
"index": [
"CATALOG_DATA_EXPORTER_PRODUCTS_MODIFIED_AT_ID",
"CATALOG_DATA_EXPORTER_PRODUCTS_MODIFIED_AT_STATUS"
]
},
"catalog_data_exporter_product_prices": {
"constraint": [
"PRIMARY"
],
"index": [
"CATALOG_DATA_EXPORTER_PRODUCT_PRICES_MODIFIED_AT_PRODUCT_ID",
"CATALOG_DATA_EXPORTER_PRODUCT_PRICES_MODIFIED_AT_STATUS"
]
},
"catalog_data_submitted_hash": {
"constraint": [
"PRIMARY"
]
}
}

0 comments on commit 00e1a84

Please sign in to comment.