SELECT url_to, r404 FROM pod_redirect WHERE BINARY REPLACE(url_from,'/ru/','/') = '/byazevye.html?pg=64' LIMIT 0,1 [0.00031208992004395 sec]
SELECT id FROM pod_cat_category WHERE entry='574' [0.00019288063049316 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_base_goods; CREATE TEMPORARY TABLE tmp_base_goods ( id INT NOT NULL PRIMARY KEY, brand_id INT, price DECIMAL(10,2), old_price DECIMAL(10,2), ordr INT, is_present TINYINT(1), sub_icon_id INT, fast_delivery TINYINT(1), is_new TINYINT(1), is_sale TINYINT(1), KEY idx_brand (brand_id) ) ENGINE=MEMORY [0.00022196769714355 sec]
INSERT INTO tmp_base_goods (id, brand_id, price, old_price, ordr, is_present, sub_icon_id, fast_delivery, is_new, is_sale) SELECT g.id, g.brand_id, g.price, g.old_price, g.ordr, g.is_present, g.sub_icon_id, g.fast_delivery, g.is_new, g.is_sale FROM pod_cat_good g WHERE g.cat_id IN (574) AND g.entry=0 AND g.is_active AND g.is_present_all_mods UNION SELECT g.id, g.brand_id, g.price, g.old_price, g.ordr, g.is_present, g.sub_icon_id, g.fast_delivery, g.is_new, g.is_sale FROM pod_cat_good g INNER JOIN pod_dop_cat_category dc ON dc.good_id = g.id WHERE dc.dop_cat_id IN (574) AND g.entry=0 AND g.is_active AND g.is_present_all_mods [0.025202035903931 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_sub_goods; CREATE TEMPORARY TABLE tmp_sub_goods ( id INT NOT NULL PRIMARY KEY, entry INT NOT NULL, price DECIMAL(10,2), old_price DECIMAL(10,2), sub_icon_id INT, is_present TINYINT(1), fast_delivery TINYINT(1), is_new TINYINT(1), is_sale TINYINT(1), KEY idx_entry (entry) ) ENGINE=MEMORY [0.00026488304138184 sec]
INSERT INTO tmp_sub_goods (id, entry, price, old_price, sub_icon_id, is_present, fast_delivery, is_new, is_sale) SELECT go.id, go.entry, go.price, go.old_price, go.sub_icon_id, go.is_present, go.fast_delivery, go.is_new, go.is_sale FROM pod_cat_good go INNER JOIN tmp_base_goods t ON go.entry = t.id WHERE go.is_active AND go.is_present [0.005558967590332 sec]
SELECT COUNT(id) amount FROM ( SELECT g.id /* cats:574 */ FROM tmp_base_goods g WHERE 1 ) A [0.00014591217041016 sec]
CREATE TEMPORARY TABLE temp_brand_counts_6a2b1611a945a ( id INT, gid INT, INDEX idx_id (id), INDEX idx_gid (gid) ) [0.00044107437133789 sec]
INSERT INTO temp_brand_counts_6a2b1611a945a (id, gid) SELECT g.brand_id AS id, g.id AS gid /* cats:574 */ FROM tmp_base_goods g WHERE 1 [0.00078320503234863 sec]
SELECT b.id, b.name_ua AS name, pc.name_ua AS country, b.country_id, b.image_icon, b.url, b.ordr, pc.code, COALESCE(tc.count, 0) as count FROM pod_cat_brand b INNER JOIN ( SELECT id, COUNT(gid) as count FROM temp_brand_counts_6a2b1611a945a GROUP BY id HAVING COUNT(gid) > 0 ) tc ON b.id = tc.id LEFT JOIN pod_country pc ON (pc.id = b.country_id AND pc.is_active = 1) WHERE b.is_active = '1' ORDER BY b.ordr [0.00041413307189941 sec]
DROP TEMPORARY TABLE IF EXISTS temp_brand_counts_6a2b1611a945a [0.00011396408081055 sec]
SELECT g.id /* cats:574 */,if(g.is_present and g.price >= '207' and g.price <= '939',least(g.price,ifnull(min(pcg.price),g.price)),ifnull(min(pcg.price),g.price)) min_sort_price, if(g.is_present and g.price >= '207' and g.price <= '939',greatest(g.price,ifnull(max(pcg.price),g.price)),ifnull(max(pcg.price),g.price)) max_sort_price FROM tmp_base_goods g LEFT JOIN pod_cat_good pcg ON pcg.entry=g.id AND pcg.is_present=1 AND pcg.price >= '207' AND pcg.price <= '939' GROUP BY g.id ORDER BY g.ordr desc LIMIT 2016, 32 [0.0037698745727539 sec]