Уважаемые гуру SQL
Нужно сделать оптимизацию сайта.
На сайт залил чуть более 3000 товара и он грузится не по детски долго ... ХЕЛП
Присутствующие медленные запросы.
SELECT DISTINCT p.product_id, ( SELECT cd.name FROM `oc_product_to_category` p2c LEFT JOIN`oc_category_description` cd ON (p2c.category_id = cd.category_id) WHERE p2c.main_category = 1 ANDp2c.product_id = p.product_id LIMIT 1) AS main_category ,REPLACE (pd.name, '"', '\"') ASname,REPLACE (p.model, '"', '\"') AS model,p.sku,p.upc,m.name ASmanufacturer,p.shipping,p.location,TRUNCATE(p.price, 2) ASprice,p.points,p.quantity,p.stock_status_id,p.LENGTH,p.width,p.height,p.weight,(SELECT su.keyword FROM`oc_url_alias` su WHERE su.query = CONCAT('product_id=', p.product_id) LIMIT 1) ASkeyword,pd.seo_title,pd.seo_h1,pd.meta_keyword,pd.meta_description,pd.description,p.image,p.sort_order,p.STATUSFROM oc_product p LEFT JOIN `oc_product_description` pd ON (p.product_id = pd.product_id) LEFT JOIN`oc_manufacturer` m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN `oc_product_to_category`p2c ON (p.product_id = p2c.product_id) WHERE pd.language_id = '1' AND (p.manufacturer_id IN(47,62,177,8,185,216,181,186,110,204,61,135,138,111,139,51,82,63,42,16,137,140,84,116,9,118,168,17,31,80,85,86,21,169,87,163,206,141,170,12,142,81,127,30,88,89,191,52,90,145,11,125,64,55,143,202,53,65,205,144,91,159,66,199,44,128,37,193,158,67,7,14,92,171,5,24,29,200,207,165,129,83,119,93,208,36,54,15,38,58,198,25,75,23,18,146,94,68,35,178,172,166,45,173,46,20,43,69,182,114,121,147,148,122,34,19,213,95,48,214,33,211,131,133,201,78,215,40,70,41,209,71,96,72,22,123,39,6,49,13,164,32,149,115,174,167,203,194,98,74,136,150,151,97,134,152,28,196,212,99,120,59,153,73,195,100,101,102,10,210,50,103,56,175,60,126,76,217,130,104,105,197,112,26,154,190,117,124,162,106,77,179,27,155,156,57,79,107,157,108,132,183,113,176,192,184,161,160,189,188,109,187))AND (p2c.category_id IN(253,254,255,256,259,258,257,249,251,250,181,189,184,188,183,202,185,186,182,187,121,84,101,103,237,236,118,238,122,148,147,144,125,124,123,119,239,93,224,88,109,100,89,77,220,78,214,132,102,79,143,240,112,73,221,74,81,213,133,75,219,76,87,246,94,96,141,113,136,114,139,142,137,138,135,243,245,244,241,242,228,68,80,252,85,145,248,159,247,83,169,67,150,151,203,210,212,204,206,205,190,218,223,191,192,193,194,199,196,198,197,195,154,229,157,234,235,231,233,230,158))ORDER BY p.product_id LIMIT 0, 10000