SELECT url_to, r404
FROM pod_redirect
WHERE BINARY REPLACE(url_from,'/ru/','/') = '/kofty_dlya_devochek/red-razmer_92-ds.html' LIMIT 0,1 [0.00052714347839355 sec]
SELECT pod_filter.id,pod_filter.url FROM pod_filter WHERE BINARY pod_filter.url IN ('red','razmer_92','ds') order by url [0.0007319450378418 sec]
SELECT pod_sub_icon.id,pod_sub_icon.url FROM pod_sub_icon WHERE BINARY pod_sub_icon.url IN ('red','razmer_92','ds') order by url [0.00053095817565918 sec]
select id,url from pod_cat_brand where BINARY url IN ('red','razmer_92','ds') [0.00091099739074707 sec]
SELECT id, url FROM pod_filter WHERE url IN ('red','razmer_92','ds') [0.00051689147949219 sec]
SELECT id, url FROM pod_sub_icon WHERE url IN ('red','razmer_92','ds') [0.00045299530029297 sec]
SELECT f.id, mf.id as mf_id, mf.is_split
FROM pod_filter f
INNER JOIN pod_filter mf ON f.entry = mf.id
WHERE f.id in (2804,24) and f.is_active AND mf.is_active
ORDER BY mf.id, f.id [0.00024008750915527 sec]
SELECT g.id -- основні
FROM pod_cat_good g
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT g.id -- підтовари
FROM
pod_cat_good go
INNER JOIN pod_cat_good g ON go.entry = g.id
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT g.id -- підтовари в допкатегорії
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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
[0.016580104827881 sec]
CREATE TEMPORARY TABLE temp_brand_counts_6a2ac163ec60a (
id INT,
gid INT,
INDEX idx_id (id),
INDEX idx_gid (gid)
) [0.00018095970153809 sec]
INSERT INTO temp_brand_counts_6a2ac163ec60a (id, gid)
SELECT g.brand_id AS id, g.id AS gid -- основні
FROM pod_cat_good g
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.is_present 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.is_present 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 go
INNER JOIN pod_cat_good g ON go.entry = g.id
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT g.brand_id AS id, g.id AS gid -- підтовари в допкатегорії
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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT id, null gid
FROM pod_cat_category
WHERE id in (1579) [0.10859704017639 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_6a2ac163ec60a
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.00064802169799805 sec]
DROP TEMPORARY TABLE IF EXISTS temp_brand_counts_6a2ac163ec60a [0.00019216537475586 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
) A
[0.0070831775665283 sec]
SELECT g.id,if(g.is_present and g.price >= '0' and g.price <= '99999',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 >= '0' and g.price <= '99999',greatest(g.price,ifnull(max(pcg.price),g.price)),ifnull(max(pcg.price),g.price)) max_sort_price
FROM (
SELECT g.id -- основні
FROM pod_cat_good g
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT g.id -- підтовари
FROM
pod_cat_good go
INNER JOIN pod_cat_good g ON go.entry = g.id
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT g.id -- підтовари в допкатегорії
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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND 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 >= '0' and pcg.price <= '99999' GROUP BY g.id
ORDER BY g.ordr desc
LIMIT 0, 32 [0.003058910369873 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0;
CREATE TEMPORARY TABLE tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 (
id INT NOT NULL,
PRIMARY KEY (id)
) ENGINE=MEMORY; [0.00030899047851562 sec]
INSERT INTO tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 (id) SELECT A.id FROM (
SELECT g.id -- основні
FROM pod_cat_good g
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT g.id -- підтовари
FROM
pod_cat_good go
INNER JOIN pod_cat_good g ON go.entry = g.id
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT g.id -- підтовари в допкатегорії
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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
) A [0.0031249523162842 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0;
CREATE TEMPORARY TABLE tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 (
goods_id INT NOT NULL,
filter_id INT NOT NULL,
PRIMARY KEY (goods_id, filter_id)
) ENGINE=MEMORY; [0.00026893615722656 sec]
INSERT INTO tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 (goods_id, filter_id)
SELECT DISTINCT
A.id AS goods_id,
f.id AS filter_id
FROM tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 A
INNER JOIN pod_good_filter gf ON A.id = gf.id_good AND gf.filter_id_value NOT IN (24,2804)
INNER JOIN pod_cat_filter cf ON gf.filter_id = cf.filter_id AND cf.category_id = 347
INNER JOIN pod_filter fm ON gf.filter_id = fm.id AND fm.is_split = 0 AND fm.is_active
INNER JOIN pod_filter f ON gf.filter_id_value = f.id AND f.is_active [0.0043060779571533 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0;
CREATE TEMPORARY TABLE tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 (
filter_id INT NOT NULL PRIMARY KEY,
count INT NOT NULL
) ENGINE=MEMORY; [0.00028085708618164 sec]
INSERT IGNORE INTO tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 (filter_id, count)
SELECT
p.filter_id,
COUNT(*) AS count
FROM tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 p
GROUP BY p.filter_id [0.00021982192993164 sec]
SELECT
c.filter_id,
c.count,
f.entry,
f.name AS name,
f.url,
f.ord,
fm.name AS mname,
fm.url AS murl,
fm.ord AS mord
FROM tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 c
INNER JOIN pod_filter f ON c.filter_id = f.id
INNER JOIN pod_filter fm ON f.entry = fm.id
ORDER BY fm.ord DESC, f.ord DESC, c.filter_id [0.00019407272338867 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 [0.0001680850982666 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 [9.0122222900391E-5 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164170a0 [7.2002410888672E-5 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2;
CREATE TEMPORARY TABLE tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 (
id INT NOT NULL,
entry INT NOT NULL,
PRIMARY KEY (id),
KEY idx_entry (entry)
) ENGINE=MEMORY; [0.00020313262939453 sec]
INSERT INTO tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 (id, entry) SELECT A.id, A.entry FROM (
SELECT g.id as id, g.id as entry -- основні
FROM pod_cat_good g
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT g.id as id, g.id as entry -- основні в допкатегорії
FROM pod_cat_good g
INNER JOIN pod_dop_cat_category dc ON dc.good_id = g.id
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT go.id as id, g.id as entry -- підтовари
FROM
pod_cat_good go
INNER JOIN pod_cat_good g ON go.entry = g.id
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT go.id as id, g.id as entry -- підтовари в допкатегорії
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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
) A [0.0031869411468506 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2;
CREATE TEMPORARY TABLE tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 (
goods_id INT NOT NULL,
filter_id INT NOT NULL,
PRIMARY KEY (goods_id, filter_id)
) ENGINE=MEMORY; [0.00029420852661133 sec]
INSERT INTO tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 (goods_id, filter_id)
SELECT DISTINCT
A.entry AS goods_id,
f.id AS filter_id
FROM tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 A
INNER JOIN pod_good_filter gf ON A.id = gf.id_good AND gf.filter_id_value NOT IN (24,2804)
INNER JOIN pod_cat_filter cf ON gf.filter_id = cf.filter_id AND cf.category_id = 347
INNER JOIN pod_filter fm ON gf.filter_id = fm.id AND fm.is_split = 1 AND fm.is_active
INNER JOIN pod_filter f ON gf.filter_id_value = f.id AND f.is_active [0.00049686431884766 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2;
CREATE TEMPORARY TABLE tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 (
filter_id INT NOT NULL PRIMARY KEY,
count INT NOT NULL
) ENGINE=MEMORY; [0.00030088424682617 sec]
INSERT IGNORE INTO tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 (filter_id, count)
SELECT
p.filter_id,
COUNT(*) AS count
FROM tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 p
GROUP BY p.filter_id [0.00033688545227051 sec]
SELECT
c.filter_id,
c.count,
f.entry,
f.name AS name,
f.url,
f.ord,
fm.name AS mname,
fm.url AS murl,
fm.ord AS mord
FROM tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 c
INNER JOIN pod_filter f ON c.filter_id = f.id
INNER JOIN pod_filter fm ON f.entry = fm.id
ORDER BY fm.ord DESC, f.ord DESC, c.filter_id [0.00026297569274902 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 [0.00027585029602051 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 [0.00014090538024902 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac164196c2 [0.00011801719665527 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5;
CREATE TEMPORARY TABLE tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 (
id INT NOT NULL,
PRIMARY KEY (id)
) ENGINE=MEMORY; [0.0002448558807373 sec]
INSERT INTO tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 (id) SELECT A.id FROM (
SELECT g.id -- основні
FROM pod_cat_good g
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present 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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT g.id -- підтовари
FROM
pod_cat_good go
INNER JOIN pod_cat_good g ON go.entry = g.id
INNER JOIN pod_good_filter gf0 ON go.id = gf0.id_good AND gf0.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT g.id -- підтовари в допкатегорії
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
INNER JOIN pod_good_filter gf0 ON go.id = gf0.id_good AND gf0.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
) A [0.0029799938201904 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5;
CREATE TEMPORARY TABLE tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 (
goods_id INT NOT NULL,
filter_id INT NOT NULL,
PRIMARY KEY (goods_id, filter_id)
) ENGINE=MEMORY; [0.00032591819763184 sec]
INSERT INTO tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 (goods_id, filter_id)
SELECT DISTINCT
A.id AS goods_id,
f.id AS filter_id
FROM tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 A
INNER JOIN pod_good_filter gf ON A.id = gf.id_good AND gf.filter_id = 20
INNER JOIN pod_filter fm ON gf.filter_id = fm.id AND fm.is_split = 0 AND fm.is_active
INNER JOIN pod_filter f ON gf.filter_id_value = f.id AND f.is_active [0.0017800331115723 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5;
CREATE TEMPORARY TABLE tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 (
filter_id INT NOT NULL PRIMARY KEY,
count INT NOT NULL
) ENGINE=MEMORY; [0.00030708312988281 sec]
INSERT INTO tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 (filter_id, count)
SELECT
p.filter_id,
COUNT(*) AS count
FROM tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 p
GROUP BY p.filter_id [0.00027894973754883 sec]
INSERT IGNORE INTO tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 (filter_id, count)
SELECT pf.id, 0
FROM pod_filter pf
LEFT JOIN tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 c ON c.filter_id = pf.id
WHERE pf.id in (24) AND c.filter_id IS NULL [0.00025296211242676 sec]
SELECT
c.filter_id,
c.count,
f.entry,
f.name AS name,
f.url,
f.ord,
fm.name AS mname,
fm.url AS murl,
fm.ord AS mord
FROM tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 c
INNER JOIN pod_filter f ON c.filter_id = f.id
INNER JOIN pod_filter fm ON f.entry = fm.id
ORDER BY fm.ord DESC, f.ord DESC, c.filter_id [0.00026512145996094 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 [0.00025486946105957 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_pairs_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 [0.00011682510375977 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641b3a5 [0.00014710426330566 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1;
CREATE TEMPORARY TABLE tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1 (
entry INT NOT NULL,
sub_icon_id INT NOT NULL,
PRIMARY KEY (entry, sub_icon_id)
) ENGINE=MEMORY; [0.00022983551025391 sec]
INSERT IGNORE INTO tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1 (entry, sub_icon_id)
SELECT DISTINCT A.entry, A.sub_icon_id FROM (
SELECT g.id as id, g.id as entry, g.sub_icon_id -- основні
FROM pod_cat_good g
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT g.id as id, g.id as entry, g.sub_icon_id -- основні в допкатегорії
FROM pod_cat_good g
INNER JOIN pod_dop_cat_category dc ON dc.good_id = g.id
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON g.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
g.is_present AND
g.is_present_all_mods AND g.entry =0 AND g.is_active
UNION
SELECT go.id as id, g.id as entry, go.sub_icon_id -- підтовари
FROM
pod_cat_good go
INNER JOIN pod_cat_good g ON go.entry = g.id
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE g.cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
UNION
SELECT go.id as id, g.id as entry, go.sub_icon_id -- підтовари в допкатегорії
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
INNER JOIN pod_good_filter gf0 ON g.id = gf0.id_good AND gf0.filter_id_value in (24)
INNER JOIN pod_good_filter gf1 ON go.id = gf1.id_good AND gf1.filter_id_value in (2804)
WHERE dc.dop_cat_id IN (347) AND
g.brand_id IN (1579) AND
go.is_present AND go.is_active AND g.is_present_all_mods AND g.is_active
) A [0.0047378540039062 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1;
CREATE TEMPORARY TABLE tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1 (
sub_icon_id INT NOT NULL PRIMARY KEY,
count INT NOT NULL
) ENGINE=MEMORY; [0.0003359317779541 sec]
INSERT IGNORE INTO tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1 (sub_icon_id, count)
SELECT
sub_icon_id,
COUNT(DISTINCT entry) AS count
FROM (
SELECT A.entry, A.sub_icon_id
FROM tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1 A
INNER JOIN pod_sub_icon si ON A.sub_icon_id = si.id AND si.is_active_filter = 1
) AA
GROUP BY sub_icon_id [0.00046300888061523 sec]
SELECT
c.sub_icon_id AS id,
c.count,
si.entry,
si.name AS name,
si.url
FROM tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1 c
INNER JOIN pod_sub_icon si ON c.sub_icon_id = si.id AND si.is_active_filter = 1
ORDER BY si.ordr, si.name [0.00024199485778809 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_A_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1 [0.00024104118347168 sec]
DROP TEMPORARY TABLE IF EXISTS tmp_counts_i303r3fnds1pinl1gud5354pcp_6a2ac1641d8f1 [0.00014281272888184 sec]
DEVELOPMENT🌷СКИДКИ ДО 70%
ПЕРЕЙТИ