SELECT url_to, r404
FROM pod_redirect
WHERE BINARY REPLACE(url_from,'/ru/','/') = '/byazevye_nav.html?order_dir=asc&pg=7' LIMIT 0,1 [0.0003659725189209 sec]
select id from pod_structure where link='catalogue/2164' and active='1' AND lang_ru='1' [0.00036406517028809 sec]
SELECT c.id, c.super_category_id, c.entry,
c.name AS name, c.title AS cat_title, c.metakwds AS cat_kwds,
c.metadesc AS cat_metadesc,
c.descr AS cat_descr,
cc.name AS parent_name, cc.url AS parent_url, c.url as curl, cc.image AS parent_image,
c.seo_text AS seo_text,
c.seo_text_mobile AS seo_text_mobile,
c.action_text AS action_text,
c.view_type, c.is_delivery_custom, c.hide_subcat_sidebar, c.image
FROM pod_cat_category c
LEFT JOIN pod_cat_category cc ON cc.id=c.entry
WHERE c.id='2164' [0.0003819465637207 sec]
SELECT id FROM pod_cat_category WHERE entry='2164' [0.00016999244689941 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_base_goods;
CREATE TEMPORARY TABLE tmp_base_goods (id INT NOT NULL PRIMARY KEY) ENGINE=MEMORY [0.00040602684020996 sec]
INSERT INTO tmp_base_goods (id)
SELECT DISTINCT g.id FROM pod_cat_good g
WHERE g.cat_id IN (2164) AND g.entry=0 AND g.is_active AND g.is_present_all_mods
UNION
SELECT DISTINCT g.id FROM pod_cat_good g
INNER JOIN pod_dop_cat_category dc ON dc.good_id = g.id
WHERE dc.dop_cat_id IN (2164) AND g.entry=0 AND g.is_active AND g.is_present_all_mods [0.005295991897583 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, KEY idx_entry (entry)) ENGINE=MEMORY [0.0003209114074707 sec]
INSERT INTO tmp_sub_goods (id, entry)
SELECT go.id, go.entry 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.01786994934082 sec]
CREATE TEMPORARY TABLE temp_brand_counts_6a2ac430eecf2 (
id INT,
gid INT,
INDEX idx_id (id),
INDEX idx_gid (gid)
) [0.0002281665802002 sec]
INSERT INTO temp_brand_counts_6a2ac430eecf2 (id, gid)
SELECT g.brand_id AS id, g.id AS gid -- основні (tmp)
FROM tmp_base_goods t
INNER JOIN pod_cat_good g ON t.id = g.id
WHERE g.is_present_all_mods AND g.is_active
[0.024381160736084 sec]
SELECT b.id, b.name AS name, pc.name 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_6a2ac430eecf2
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.0010850429534912 sec]
DROP TEMPORARY TABLE IF EXISTS temp_brand_counts_6a2ac430eecf2 [0.00022387504577637 sec]
SELECT g.id,if(g.is_present and g.price >= '490' and g.price <= '14050',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 >= '490' and g.price <= '14050',greatest(g.price,ifnull(max(pcg.price),g.price)),ifnull(max(pcg.price),g.price)) max_sort_price
FROM (
SELECT g.id -- основні (tmp)
FROM tmp_base_goods t
INNER JOIN pod_cat_good g ON t.id = g.id
WHERE g.is_present_all_mods AND g.is_active
) a INNER JOIN pod_cat_good g ON a.id = g.id
LEFT JOIN pod_cat_good pcg ON pcg.entry=g.id and pcg.is_present=1 and pcg.is_present=1 and pcg.price >= '490' and pcg.price <= '14050' GROUP BY g.id
ORDER BY g.ordr asc
LIMIT 192, 32 [0.011581897735596 sec]
SELECT g.video, g.threedvideo, g.is_xit, g.is_action, g.is_sale,
g.sub_is_action, g.is_new, g.is_pay_for_video, g.id, g.cat_id,
g.name AS name, g.name2 AS name2, g.descr, g.size_table, g.artikul, g.image_small,
g.image_big, g.price, g.old_price, g.is_present,
g.is_present_all_mods, g.sub_icon_id,g.url,g.ordr, g.last_items, g.fast_delivery, g.free_delivery, g.gift,
g.timer, g.action_validity,
b.name AS brand_name,b.url as burl,b.id as bid, b.country AS brand_country,c.url as curl, c.name AS cat_name,
si.name AS sub_icon_name,si.icon AS sub_icon,
g.star, g.comment_id, if(g.is_present and g.price >= '490' and g.price <= '14050',least(g.price,ifnull(min(pcg.price),g.price)),ifnull(min(pcg.price),g.price)) as min_sort_price,
if(g.is_present and g.price >= '490' and g.price <= '14050',greatest(g.price,ifnull(max(pcg.price),g.price)),ifnull(max(pcg.price),g.price)) as max_sort_price
FROM pod_cat_good g
INNER JOIN pod_cat_category c ON c.id=g.cat_id
LEFT JOIN pod_cat_brand b ON b.id=g.brand_id
LEFT JOIN pod_sub_icon si ON si.id=g.sub_icon_id
LEFT JOIN pod_cat_good pcg ON (pcg.entry=g.id and pcg.is_present=1 and pcg.price >= '490' and pcg.price <= '14050')
WHERE g.id in (393956,393948,393944,393932,419763,419754,419764,319196,298886,322999,323359,298885,366670,298884,322987,298883,322983,322991,322957,322979,319236,322975,366702,319232,319192,366698,319228,298894,323393,319188,366690,319220)
GROUP BY g.id
ORDER BY g.ordr asc [0.0035278797149658 sec]
SELECT g.ordr, g.is_xit, g.is_pay_for_video, g.is_action, g.is_sale, g.is_new, g.last_items, g.fast_delivery, g.free_delivery, g.gift,
g.timer, g.action_validity,
g.id, g.entry, g.name AS name, g.price, g.old_price, g.artikul, g.sub_icon_id, g.is_present, si.name AS sub_icon_name, si.icon AS sub_icon
FROM pod_cat_good g
LEFT JOIN pod_sub_icon si ON si.id = g.sub_icon_id
WHERE g.entry IN (393956,393948,393944,393932,419763,419754,419764,319196,298886,322999,323359,298885,366670,298884,322987,298883,322983,322991,322957,322979,319236,322975,366702,319232,319192,366698,319228,298894,323393,319188,366690,319220) AND g.is_active = '1'
ORDER BY g.entry, g.is_present DESC [0.0015041828155518 sec]
SELECT DISTINCT
ggd2.good_id AS source_good_id,
g.id, g.is_present_all_mods,
pc.name AS name,
g.url,
b.url as burl, c.url as curl,
g.is_present,
pc.code AS color_code,
gg.group_type,
gg.param_name,
gg.param_name_ua,
ggd.text_value,
ggd.icon_path
FROM pod_goods_group_goods ggd2
JOIN pod_goods_group_goods ggd ON ggd2.goods_group_id=ggd.goods_group_id
JOIN pod_goods_group gg ON ggd.goods_group_id=gg.id
JOIN pod_cat_good g ON g.id=ggd.good_id
LEFT JOIN pod_cat_brand b ON g.brand_id=b.id
LEFT JOIN pod_cat_category c ON g.cat_id=c.id
LEFT JOIN pod_colors pc ON pc.id=ggd.color_id
WHERE ggd2.good_id IN (393956,393948,393944,393932,419763,419754,419764,319196,298886,322999,323359,298885,366670,298884,322987,298883,322983,322991,322957,322979,319236,322975,366702,319232,319192,366698,319228,298894,323393,319188,366690,319220)
ORDER BY ggd2.good_id, g.is_present_all_mods DESC [0.0029408931732178 sec]