#1
⏱️ 31.88 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"nahariya"]
#2
⏱️ 104.55 мс
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",766,1123,1254,446,1362,10,241,410,true,766,1123,1254,446,1362,10,241,410,"produce"]
#3
⏱️ 78.29 мс
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",766,1123,1254,446,1362,10,241,410,true,766,1123,1254,446,1362,10,241,410,"produce"]
#4
⏱️ 3.1 мс
select * from "canonical_products" where "canonical_products"."id" in (8, 18, 47, 90, 149, 158, 223, 247, 254, 271, 283, 322, 338, 339)
#5
⏱️ 2.07 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[90,149,158,8,338,283,47,254,18,339,223,271,247,322]
#6
⏱️ 19.37 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6744655,6708345,4039359,3876067,3580503,3579307,3574922,3481625,3476224,3475954,3385632,3170808,3119358,2975667,2685274,2681776,2680729,2678023,2676541,2673219,2670978,2662892,2662633,2660155,2658613,2640041,2634528,2633252,2631143,2630254,2630188,2610312,1462716,123050,3041110,160427,2812826,193200,135114,1458061,1909941,1930007,205836,112818,127440,129463,129450,3719257,2868709,133464,1431159,1926821,95618,109104,126588,149383,122818,4546313,109373,125134,109847,true,766,1123,1254,446,1362,10,241,410]
#7
⏱️ 0.88 мс
select * from "stores" where "stores"."id" in (10, 410)
#8
⏱️ 9.09 мс
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 = 1462716 THEN 3170808 WHEN sp.master_product_id = 3170808 THEN 3170808 WHEN sp.master_product_id = 123050 THEN 3170808 WHEN sp.master_product_id = 3041110 THEN 3170808 WHEN sp.master_product_id = 160427 THEN 3170808 WHEN sp.master_product_id = 2812826 THEN 3170808 WHEN sp.master_product_id = 193200 THEN 2662633 WHEN sp.master_product_id = 2662633 THEN 2662633 WHEN sp.master_product_id = 2673219 THEN 2673219 WHEN sp.master_product_id = 135114 THEN 2673219 WHEN sp.master_product_id = 1458061 THEN 4039359 WHEN sp.master_product_id = 1909941 THEN 4039359 WHEN sp.master_product_id = 1930007 THEN 4039359 WHEN sp.master_product_id = 205836 THEN 4039359 WHEN sp.master_product_id = 112818 THEN 4039359 WHEN sp.master_product_id = 4039359 THEN 4039359 WHEN sp.master_product_id = 127440 THEN 4039359 WHEN sp.master_product_id = 129463 THEN 4039359 WHEN sp.master_product_id = 3876067 THEN 3876067 WHEN sp.master_product_id = 129450 THEN 3876067 WHEN sp.master_product_id = 3719257 THEN 3876067 WHEN sp.master_product_id = 3481625 THEN 3481625 WHEN sp.master_product_id = 2868709 THEN 3481625 WHEN sp.master_product_id = 133464 THEN 2640041 WHEN sp.master_product_id = 1431159 THEN 2640041 WHEN sp.master_product_id = 1926821 THEN 2640041 WHEN sp.master_product_id = 2640041 THEN 2640041 WHEN sp.master_product_id = 95618 THEN 2640041 WHEN sp.master_product_id = 109104 THEN 2640041 WHEN sp.master_product_id = 126588 THEN 2630254 WHEN sp.master_product_id = 2630254 THEN 2630254 WHEN sp.master_product_id = 149383 THEN 2662892 WHEN sp.master_product_id = 2662892 THEN 2662892 WHEN sp.master_product_id = 2633252 THEN 2633252 WHEN sp.master_product_id = 122818 THEN 2633252 WHEN sp.master_product_id = 4546313 THEN 2680729 WHEN sp.master_product_id = 2680729 THEN 2680729 WHEN sp.master_product_id = 109373 THEN 2630188 WHEN sp.master_product_id = 2630188 THEN 2630188 WHEN sp.master_product_id = 125134 THEN 2685274 WHEN sp.master_product_id = 2685274 THEN 2685274 WHEN sp.master_product_id = 2658613 THEN 2658613 WHEN sp.master_product_id = 109847 THEN 2658613 ELSE sp.master_product_id END limit 500
Bindings:
[6744655,6708345,4039359,3876067,3580503,3579307,3574922,3481625,3476224,3475954,3385632,3170808,3119358,2975667,2685274,2681776,2680729,2678023,2676541,2673219,2670978,2662892,2662633,2660155,2658613,2640041,2634528,2633252,2631143,2630254,2630188,2610312,1462716,123050,3041110,160427,2812826,193200,135114,1458061,1909941,1930007,205836,112818,127440,129463,129450,3719257,2868709,133464,1431159,1926821,95618,109104,126588,149383,122818,4546313,109373,125134,109847,0,766,1123,1254,446,1362,10,241,410]
#9
⏱️ 10.59 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[815042,922308,1501907,77925580,2236507,2225313,2228127,2232482,2235451,2230966,2227801,2229990,2231112,2231304,2226755,2225779,11017069,2227304,2226743,33374635,2227017,10984062,2229911,2225682,33374717,11021307,11021503,10993244,29603012,29611674,29614681,2230610,2229222,10993010,11013719,517524]
#10
⏱️ 3.81 мс
select * from "stores" where "stores"."id" in (10, 241, 410, 446, 766)
#11
⏱️ 1.27 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["nahariya"]
#12
⏱️ 2.53 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 2.25 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]