SELECT url_to, r404
FROM pod_redirect
WHERE BINARY REPLACE(url_from,'/ru/','/') = '/ranfors/mirson-diva-lefard.html' LIMIT 0,1 [0.00047516822814941 sec]
SELECT pod_filter.id,pod_filter.url FROM pod_filter WHERE BINARY pod_filter.url IN ('mirson','diva','lefard') order by url [0.0015687942504883 sec]
SELECT pod_sub_icon.id,pod_sub_icon.url FROM pod_sub_icon WHERE BINARY pod_sub_icon.url IN ('mirson','diva','lefard') order by url [0.001284122467041 sec]
select id,url from pod_cat_brand where BINARY url = 'mirson-diva-lefard' [0.0018110275268555 sec]
select id,url from pod_cat_brand where url = 'mirson-diva-lefard' [0.00039005279541016 sec]
select id,url from pod_cat_brand where url in ('mirson','diva','lefard') [0.00054693222045898 sec]
SELECT g.id -- основні
FROM pod_cat_good g USE INDEX (idx_cat_entry_active_present)
WHERE g.cat_id IN (202) AND
g.brand_id IN (2134,2147,1359) AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT 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 (202) AND
g.brand_id IN (2134,2147,1359) AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
[0.17688798904419 sec]
CREATE TEMPORARY TABLE temp_brand_counts_6a2aa225b2782 (
id INT,
gid INT,
INDEX idx_id (id),
INDEX idx_gid (gid)
) [0.0005190372467041 sec]
INSERT INTO temp_brand_counts_6a2aa225b2782 (id, gid)
SELECT g.brand_id AS id, g.id AS gid -- основні
FROM pod_cat_good g USE INDEX (idx_cat_entry_active_present)
WHERE g.cat_id IN (202) AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT g.brand_id AS id, g.id AS gid -- основні в допкатегорії
FROM pod_cat_good g
INNER JOIN pod_dop_cat_category dc ON dc.good_id = g.id
WHERE dc.dop_cat_id IN (202) AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT id, null gid
FROM pod_cat_category
WHERE id in (2134,2147,1359) [0.012044906616211 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_6a2aa225b2782
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.0013501644134521 sec]
DROP TEMPORARY TABLE IF EXISTS temp_brand_counts_6a2aa225b2782 [0.00023698806762695 sec]
SELECT MIN(min_price) AS min_price, MAX(max_price) AS max_price
FROM (
SELECT MIN(g.price) AS min_price, MAX(g.price) AS max_price -- основні
FROM pod_cat_good g USE INDEX (idx_cat_entry_active_present)
WHERE g.cat_id IN (202) AND
g.brand_id IN (2134,2147,1359) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT MIN(g.price) AS min_price, MAX(g.price) AS max_price -- основні в допкатегорії
FROM pod_cat_good g
INNER JOIN pod_dop_cat_category dc ON dc.good_id = g.id
WHERE dc.dop_cat_id IN (202) AND
g.brand_id IN (2134,2147,1359) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT MIN(go.price) AS min_price, MAX(go.price) AS max_price -- підтовари
FROM
pod_cat_good go
INNER JOIN pod_cat_good g ON go.entry = g.id
WHERE g.cat_id IN (202) AND
g.brand_id IN (2134,2147,1359) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT MIN(go.price) AS min_price, MAX(go.price) AS max_price -- підтовари в допкатегорії
FROM pod_cat_good go
INNER JOIN pod_cat_good g ON go.entry = g.id
INNER JOIN pod_dop_cat_category dc ON dc.good_id = g.id
WHERE dc.dop_cat_id IN (202) AND
g.brand_id IN (2134,2147,1359) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
) A
[0.021130084991455 sec]
SELECT g.id, if(g.is_present and g.price >= '1559' and g.price <= '7399',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 >= '1559' and g.price <= '7399',greatest(g.price,ifnull(max(pcg.price),g.price)),ifnull(max(pcg.price),g.price)) max_sort_price
FROM pod_cat_good g
LEFT JOIN pod_cat_good pcg ON pcg.entry=g.id and pcg.is_present=1 and pcg.is_present=1 and pcg.price >= '1559' and pcg.price <= '7399' WHERE g.id in (395871,473036,334856,395694,395701,395715,395722,395804,395818,395825,471077,471084,471091,471098,471112,471119,471855,472593,472668,472673,472678,472683,472982,473050,473057,473064,473071,475272,475277,475510,475515,475520,475525,475530,475535,475540,475545,475550,475565,475572,475586,475600,475724,475731,475909,475960,475974,475998,476005,476017,476151,476165,476450,476457,476464,476471,476478,476721,476728,476735,483928,483935,483941,485730,485731,485747,498050,498051)
GROUP BY g.id
ORDER BY g.ordr desc
LIMIT 0, 32 [0.0090179443359375 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 >= '1559' and g.price <= '7399',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 >= '1559' and g.price <= '7399',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 >= '1559' and pcg.price <= '7399')
WHERE g.id in (334856,395694,395804,395722,395871,395715,395701,395818,471084,471119,472673,473036,473071,475515,475535,475565,475724,475974,476151,476464,476728,483941,498050,395825,471091,471855,472678,473050,475272,475520,475540,475572)
GROUP BY g.id
ORDER BY g.ordr desc [0.0086901187896729 sec]