I have a Magento2 application as well as it has around 3637 items. The trouble is that the magazine>> items web page on the admin side is packing extremely gradually, it takes about 4 mins to pack the web page. So inspecting the go to the web server I located that the matter question is taking way too much time to carry out.
CHOOSE ‘e’. *, ‘at_qty’.’ qty’,.
( SELECT GROUP_CONCAT( DISTINCT( ccev.value)) AS ‘category_value’ FROM ‘catalog_category_entity_varchar’ AS ‘ccev’.
INTERNAL SIGN UP WITH ‘catalog_category_product’ AS ‘ccp’ IN WHICH (ccp.category _ id = ccev.entity _ id as well as (ccp.product _ id= e.entity _ id) as well as ccev.attribute _ id=’ 45′)) AS ‘classifications’,.
( SELECT MAX( DISTINCT( lsoi.created _ at)) AS ‘item_last_purchase’ FROM ‘sales_order_item’ AS ‘lsoi’ IN WHICH (lsoi.product _ id= e.entity _ id)) AS ‘last_purchase’,.
COALESCE( AMOUNT(‘ soi’.’ qty_ordered’), 0) AS ‘qty_sold’,.
IF(‘ at_qty’.’ qty’ < < 1, 1,0) AS 'low_stock',. ' at_quantity_and_stock_status'.' is_in_stock' AS 'quantity_and_stock_status' FROM 'catalog_product_entity' AS 'e'. LEFT SIGN UP WITH 'cataloginventory_stock_item' AS 'at_qty' ON (at_qty.' product_id'= e.entity _ id) AND ALSO (at_qty. stock_id= 1). LEFT SIGN UP WITH (SELECT 'csoi'.' qty_ordered', 'csoi'.' sku', 'csoi'.' product_id' FROM 'sales_order_item' AS 'csoi'. LEFT SIGN UP WITH 'sales_order' AS 'so' ON csoi.order _ id = so.entity _ id in which (so.status IN (''-RRB-)) AS 'soi 'ON (e.sku = soi.sku) OR (e.entity _ id = soi.product _ id). LEFT SIGN UP WITH 'cataloginventory_stock_item 'AS 'at_quantity_and_stock_status 'ON (at_quantity_and_stock_status. 'product_id '= e.entity _ id) AND ALSO (at_quantity_and_stock_status. stock_id= 1) TEAM BY 'e '. 'entity_id '. ) AS't ';
After examining I have actually located that the problem results from sales_order_item table question which is having about 60000 rows. So can I get rid of that from the question to boost efficiency as it is not needed for the matter? Or exists otherwise to boost efficiency? Which data I require to modify for transforming the question?(*)