#1
⏱️ 129.58 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"beit-shemesh"]
#2
⏱️ 441.54 мс
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",742,273,479,24,true,742,273,479,24,"produce"]
#3
⏱️ 215.28 мс
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",742,273,479,24,true,742,273,479,24,"produce"]
#4
⏱️ 2.44 мс
select * from "canonical_products" where "canonical_products"."id" in (7, 16, 31, 34, 35, 37, 90, 135, 139, 216, 223, 239)
#5
⏱️ 3.56 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[37,31,16,139,90,239,7,34,35,135,223,216]
#6
⏱️ 37.48 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,7472471,7455068,7454739,7446739,7441884,7431628,6908951,6744655,6708345,5130389,4039359,3918165,3915123,3713449,3225948,2922879,2676248,2647878,2642320,2641891,2640041,2636398,2634528,2615066,8775708,8775709,8775781,864799,133464,1431159,3914999,199262,1926821,190929,95617,150763,8775707,8775710,8775711,199256,1458061,8775712,1909941,2609947,109102,7471561,133465,133482,115658,111499,1993337,406907,113731,95618,133470,1930007,96458,205836,109104,112818,150773,109100,109467,133472,95635,95620,2712622,170223,114703,115686,127440,129463,126818,true,742,273,479,24]
#7
⏱️ 3.42 мс
select * from "stores" where "stores"."id" in (24, 273, 742)
#8
⏱️ 9.6 мс
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 = 864799 THEN 3713449 WHEN sp.master_product_id = 133464 THEN 2640041 WHEN sp.master_product_id = 2676248 THEN 2676248 WHEN sp.master_product_id = 3713449 THEN 3713449 WHEN sp.master_product_id = 7454739 THEN 7454739 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 = 199262 THEN 3713449 WHEN sp.master_product_id = 1926821 THEN 2640041 WHEN sp.master_product_id = 190929 THEN 2922879 WHEN sp.master_product_id = 95617 THEN 3713449 WHEN sp.master_product_id = 150763 THEN 3225948 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 = 199256 THEN 3225948 WHEN sp.master_product_id = 2922879 THEN 2922879 WHEN sp.master_product_id = 1458061 THEN 4039359 WHEN sp.master_product_id = 2640041 THEN 2640041 WHEN sp.master_product_id = 8775712 THEN 8775713 WHEN sp.master_product_id = 3225948 THEN 3225948 WHEN sp.master_product_id = 1909941 THEN 4039359 WHEN sp.master_product_id = 2609947 THEN 8775713 WHEN sp.master_product_id = 109102 THEN 3225948 WHEN sp.master_product_id = 7471561 THEN 8775528 WHEN sp.master_product_id = 133465 THEN 3713449 WHEN sp.master_product_id = 133482 THEN 3225948 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 = 1993337 THEN 3225948 WHEN sp.master_product_id = 406907 THEN 3713449 WHEN sp.master_product_id = 113731 THEN 2615066 WHEN sp.master_product_id = 95618 THEN 2640041 WHEN sp.master_product_id = 133470 THEN 2922879 WHEN sp.master_product_id = 1930007 THEN 4039359 WHEN sp.master_product_id = 96458 THEN 7454739 WHEN sp.master_product_id = 205836 THEN 4039359 WHEN sp.master_product_id = 109104 THEN 2640041 WHEN sp.master_product_id = 112818 THEN 4039359 WHEN sp.master_product_id = 150773 THEN 2922879 WHEN sp.master_product_id = 109100 THEN 3713449 WHEN sp.master_product_id = 109467 THEN 2922879 WHEN sp.master_product_id = 133472 THEN 7454739 WHEN sp.master_product_id = 95635 THEN 3225948 WHEN sp.master_product_id = 95620 THEN 2922879 WHEN sp.master_product_id = 2712622 THEN 7454739 WHEN sp.master_product_id = 170223 THEN 3713449 WHEN sp.master_product_id = 4039359 THEN 4039359 WHEN sp.master_product_id = 114703 THEN 8775713 WHEN sp.master_product_id = 115686 THEN 8775713 WHEN sp.master_product_id = 127440 THEN 4039359 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,7472471,7455068,7454739,7446739,7441884,7431628,6908951,6744655,6708345,5130389,4039359,3918165,3915123,3713449,3225948,2922879,2676248,2647878,2642320,2641891,2640041,2636398,2634528,2615066,8775708,8775709,8775781,864799,133464,1431159,3914999,199262,1926821,190929,95617,150763,8775707,8775710,8775711,199256,1458061,8775712,1909941,2609947,109102,7471561,133465,133482,115658,111499,1993337,406907,113731,95618,133470,1930007,96458,205836,109104,112818,150773,109100,109467,133472,95635,95620,2712622,170223,114703,115686,127440,129463,126818,0,742,273,479,24]
#9
⏱️ 12.07 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5874585,5874587,5874601,5874584,5877156,5748555,5748557,5748569,5748554,5761585,78525338,2522027,2520203,2517412,2517582,2520745,2521208,2520209,2520220,2520204,2517655,12048839,2520316,78528190,78531364,2517583,2517470,31667002,2520746,2520211,78525734,2521209,2520299,4116474,3874083,9559640,3882855,3874040,3873954,3956256,4024841,3835899,9560123,9560330,9560445,9560744,9570910,9581306,4066680,9613069]
#10
⏱️ 4.29 мс
select * from "stores" where "stores"."id" in (24, 273, 479, 742)
#11
⏱️ 3.08 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["beit-shemesh"]
#12
⏱️ 6.04 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 4.45 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]