#1
⏱️ 177.33 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"nazareth"]
#2
⏱️ 927.12 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_slug" = ? and "subcategory_slug" = ? and (exists (select 1 from "store_prices" where "store_prices"."master_product_id" = "master_products"."id" and "store_prices"."store_id" in (?, ?, ?, ?, ?, ?)) or exists (select 1 from "deals" where "deals"."master_product_id" = "master_products"."id" and "deals"."is_active" = ? and "deals"."store_id" in (?, ?, ?, ?, ?, ?))) and master_products.id IN (
SELECT DISTINCT ON (COALESCE(canonical_product_id, -id)) id
FROM master_products
WHERE category_slug = ?
ORDER BY COALESCE(canonical_product_id, -id),
CASE WHEN image_url IS NOT NULL AND image_url != '' THEN 0 ELSE 1 END,
id DESC
)
Bindings:
["produce","vegetables",744,107,26,475,669,183,true,744,107,26,475,669,183,"produce"]
#3
⏱️ 493.18 мс
select * from "master_products" where "barcode" is not null and "category_slug" = ? and "subcategory_slug" = ? and (exists (select 1 from "store_prices" where "store_prices"."master_product_id" = "master_products"."id" and "store_prices"."store_id" in (?, ?, ?, ?, ?, ?)) or exists (select 1 from "deals" where "deals"."master_product_id" = "master_products"."id" and "deals"."is_active" = ? and "deals"."store_id" in (?, ?, ?, ?, ?, ?))) and master_products.id IN (
SELECT DISTINCT ON (COALESCE(canonical_product_id, -id)) id
FROM master_products
WHERE category_slug = ?
ORDER BY COALESCE(canonical_product_id, -id),
CASE WHEN image_url IS NOT NULL AND image_url != '' THEN 0 ELSE 1 END,
id DESC
) order by CASE WHEN master_products.image_url IS NOT NULL AND master_products.image_url != '' THEN 0 ELSE 1 END, "master_products"."id" desc limit 32 offset 0
Bindings:
["produce","vegetables",744,107,26,475,669,183,true,744,107,26,475,669,183,"produce"]
#4
⏱️ 17.39 мс
select * from "canonical_products" where "canonical_products"."id" in (8, 16, 31, 37, 44, 90, 105, 112, 135, 138, 216, 223, 237, 239)
#5
⏱️ 7.56 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[37,31,16,44,90,237,239,8,138,105,135,112,223,216]
#6
⏱️ 81.91 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?)
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,7466366,7441884,7431628,7428697,6744655,6708345,5130389,4039359,3918166,3918165,3915123,3700683,3170808,2986223,2896664,2877891,2676248,2671623,2647878,2642320,2641891,2640041,2636398,2615066,8775708,8775709,8775781,98238,107092,1456443,97366,95630,1930007,1431159,3914999,160965,246685,1926821,1462716,8775707,8775710,8775711,190894,1458061,132357,97351,205836,8775712,1915898,1909941,2609947,7471561,123050,115658,111499,3041110,1455029,113731,1986966,1907936,95618,133464,193911,109104,109897,133463,112818,100698,95650,1961259,160427,109313,111087,2812826,114703,2637094,115686,127440,164587,129463,126818,true,744,107,26,475,669,183]
#7
⏱️ 3.44 мс
select * from "stores" where "stores"."id" in (26, 107, 744)
#8
⏱️ 35.9 мс
select min(sp.id) as best_sp_id from "store_prices" as "sp" where "sp"."master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "sp"."price" > ? and "sp"."store_id" in (?, ?, ?, ?, ?, ?) group by sp.store_id, CASE WHEN sp.master_product_id = 8775528 THEN 8775528 WHEN sp.master_product_id = 8775708 THEN 8775713 WHEN sp.master_product_id = 8775709 THEN 8775713 WHEN sp.master_product_id = 8775781 THEN 8775782 WHEN sp.master_product_id = 98238 THEN 2986223 WHEN sp.master_product_id = 7428697 THEN 7428697 WHEN sp.master_product_id = 107092 THEN 2986223 WHEN sp.master_product_id = 1456443 THEN 2896664 WHEN sp.master_product_id = 2676248 THEN 2676248 WHEN sp.master_product_id = 97366 THEN 2896664 WHEN sp.master_product_id = 3170808 THEN 3170808 WHEN sp.master_product_id = 95630 THEN 2896664 WHEN sp.master_product_id = 1930007 THEN 4039359 WHEN sp.master_product_id = 2615066 THEN 2615066 WHEN sp.master_product_id = 1431159 THEN 2640041 WHEN sp.master_product_id = 3914999 THEN 3918165 WHEN sp.master_product_id = 3918165 THEN 3918165 WHEN sp.master_product_id = 160965 THEN 7428697 WHEN sp.master_product_id = 246685 THEN 2896664 WHEN sp.master_product_id = 1926821 THEN 2640041 WHEN sp.master_product_id = 1462716 THEN 3170808 WHEN sp.master_product_id = 8775707 THEN 8775713 WHEN sp.master_product_id = 8775710 THEN 8775713 WHEN sp.master_product_id = 8775711 THEN 8775713 WHEN sp.master_product_id = 8775782 THEN 8775782 WHEN sp.master_product_id = 3918166 THEN 3918166 WHEN sp.master_product_id = 190894 THEN 2986223 WHEN sp.master_product_id = 1458061 THEN 4039359 WHEN sp.master_product_id = 2640041 THEN 2640041 WHEN sp.master_product_id = 132357 THEN 2671623 WHEN sp.master_product_id = 97351 THEN 2986223 WHEN sp.master_product_id = 2986223 THEN 2986223 WHEN sp.master_product_id = 205836 THEN 4039359 WHEN sp.master_product_id = 8775712 THEN 8775713 WHEN sp.master_product_id = 1915898 THEN 2986223 WHEN sp.master_product_id = 1909941 THEN 4039359 WHEN sp.master_product_id = 2609947 THEN 8775713 WHEN sp.master_product_id = 7471561 THEN 8775528 WHEN sp.master_product_id = 123050 THEN 3170808 WHEN sp.master_product_id = 115658 THEN 8775713 WHEN sp.master_product_id = 8775713 THEN 8775713 WHEN sp.master_product_id = 111499 THEN 8775713 WHEN sp.master_product_id = 3041110 THEN 3170808 WHEN sp.master_product_id = 1455029 THEN 2986223 WHEN sp.master_product_id = 113731 THEN 2615066 WHEN sp.master_product_id = 1986966 THEN 2986223 WHEN sp.master_product_id = 1907936 THEN 2986223 WHEN sp.master_product_id = 95618 THEN 2640041 WHEN sp.master_product_id = 133464 THEN 2640041 WHEN sp.master_product_id = 2671623 THEN 2671623 WHEN sp.master_product_id = 193911 THEN 3918166 WHEN sp.master_product_id = 109104 THEN 2640041 WHEN sp.master_product_id = 109897 THEN 2896664 WHEN sp.master_product_id = 133463 THEN 2986223 WHEN sp.master_product_id = 112818 THEN 4039359 WHEN sp.master_product_id = 100698 THEN 2896664 WHEN sp.master_product_id = 95650 THEN 2986223 WHEN sp.master_product_id = 2896664 THEN 2896664 WHEN sp.master_product_id = 1961259 THEN 3918166 WHEN sp.master_product_id = 160427 THEN 3170808 WHEN sp.master_product_id = 109313 THEN 2986223 WHEN sp.master_product_id = 111087 THEN 2896664 WHEN sp.master_product_id = 2812826 THEN 3170808 WHEN sp.master_product_id = 4039359 THEN 4039359 WHEN sp.master_product_id = 114703 THEN 8775713 WHEN sp.master_product_id = 2637094 THEN 2986223 WHEN sp.master_product_id = 115686 THEN 8775713 WHEN sp.master_product_id = 127440 THEN 4039359 WHEN sp.master_product_id = 164587 THEN 2896664 WHEN sp.master_product_id = 129463 THEN 4039359 WHEN sp.master_product_id = 126818 THEN 2676248 ELSE sp.master_product_id END limit 500
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,7466366,7441884,7431628,7428697,6744655,6708345,5130389,4039359,3918166,3918165,3915123,3700683,3170808,2986223,2896664,2877891,2676248,2671623,2647878,2642320,2641891,2640041,2636398,2615066,8775708,8775709,8775781,98238,107092,1456443,97366,95630,1930007,1431159,3914999,160965,246685,1926821,1462716,8775707,8775710,8775711,190894,1458061,132357,97351,205836,8775712,1915898,1909941,2609947,7471561,123050,115658,111499,3041110,1455029,113731,1986966,1907936,95618,133464,193911,109104,109897,133463,112818,100698,95650,1961259,160427,109313,111087,2812826,114703,2637094,115686,127440,164587,129463,126818,0,744,107,26,475,669,183]
#9
⏱️ 14.03 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5823224,5823234,5825268,6432793,6432798,11999204,2498328,35724114,2499756,11993011,2499456,11999097,11994392,2498588,2498327,2498406,31631100,2496566,11994643,11994644,2498603,37786054,35724237,33747484,30191424,30186716,31623983,4116476,3874085,9559642,3828333,3879675,3956258,4024843,9560125,9560332,9560447,9560746,9570912,9581308,4066682,9613071]
#10
⏱️ 1.66 мс
select * from "stores" where "stores"."id" in (26, 107, 475, 744)
#11
⏱️ 9.63 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["nazareth"]
#12
⏱️ 13.11 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 17.82 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]