Skip to content

Magento 2 DB Locks

I’m running Magento 2 and since a recent upgrade my DB seems to be having DB locks quite a lot, yesterday it happened at least 3 times, my developers are unable to find the source of the problem and neither can my host.

The host has provided this in relation to the latest outage:

 39319 | devel | localhost | sparetoolnewlive | Query | 21089 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_entity_int` AS `at_visibility_default` ON (`at_visibility_default`.`entity_id` = `e`.`entity_id`) AND (`at_visibility_default`.`attribute_id` = '102') AND `at_visibility_default`.`store_id` = 0
LEFT JOIN `catalog_product_entity_int` AS `at_visibility` ON (`at_visibility`.`entity_id` = `e`.`entity_id`) AND (`at_visibility`.`attribute_id` = '102') AND (`at_visibility`.`store_id` = 1)
INNER JOIN `catalog_product_entity_int` AS `at_status_default` ON (`at_status_default`.`entity_id` = `e`.`entity_id`) AND (`at_status_default`.`attribute_id` = '96') AND `at_status_default`.`store_id` = 0
LEFT JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '96') AND (`at_status`.`store_id` = 1)
INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = 1 WHERE (IF(at_visibility.value_id > 0, at_visibility.value, at_visibility_default.value) NOT IN(1)) AND (IF(at_status.value_id > 0, at_status.value, at_status_default.value) IN(1)) | 0.000 |

There are a few of these causing a backlog in processing with a rather large runtime.

||||||||||
|-|-|-|-|-|-|-|-|-|
| 39319 | devel | localhost | sparetoolnewlive | Query | 21139 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entity AS e INNER JOIN catalog_product | 0.000 | | 39340 | devel | localhost | sparetoolnewlive | Query | 21134 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entityASeINNER JOINcatalog_product | 0.000 |
| 39343 | devel | localhost | sparetoolnewlive | Query | 21134 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entity AS e INNER JOIN catalog_product | 0.000 | | 39368 | devel | localhost | sparetoolnewlive | Query | 21131 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entityASeINNER JOINcatalog_product | 0.000 |
| 39369 | devel | localhost | sparetoolnewlive | Query | 21131 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entity AS e INNER JOIN catalog_product | 0.000 | | 39370 | devel | localhost | sparetoolnewlive | Query | 21130 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entityASeINNER JOINcatalog_product | 0.000 |
| 39371 | devel | localhost | sparetoolnewlive | Query | 21130 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entity AS e INNER JOIN catalog_product | 0.000 | | 40396 | devel | localhost | sparetoolnewlive | Query | 20549 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entityASeINNER JOINcatalog_product | 0.000 |
| 44627 | devel | localhost | sparetoolnewlive | Query | 17489 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entity AS e INNER JOIN catalog_product | 0.000 | | 54857 | devel | localhost | sparetoolnewlive | Query | 10247 | Sending data | SELECT COUNT(DISTINCT e.entity_id) FROM catalog_product_entityASeINNER JOIN catalog_product | 0.000

Unfortunately I’m not a coder or a designer. I just own the business, so I can’t get involved nor understand any technical chat 😛

I can relay information to my developers/web host but that’s about it 🙁

Looking forward to any feedback

Thanks
James