#1
⏱️ 103.8 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"netivot"]
#2
⏱️ 275.46 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_slug" = ? and "master_products"."id" in ((select "master_product_id" from "store_prices" where "store_id" in (?, ?)) union (select "master_product_id" from "deals" where "is_active" = ? and "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",445,623,true,445,623,"produce"]
#3
⏱️ 218.42 мс
select * from "master_products" where "barcode" is not null and "category_slug" = ? and "master_products"."id" in ((select "master_product_id" from "store_prices" where "store_id" in (?, ?)) union (select "master_product_id" from "deals" where "is_active" = ? and "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",445,623,true,445,623,"produce"]
#4
⏱️ 11.98 мс
select * from "canonical_products" where "canonical_products"."id" in (12, 75, 87, 126, 140, 257, 276, 279, 320, 338)
#5
⏱️ 9.37 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[140,87,257,279,276,75,126,320,12,338]
#6
⏱️ 29.31 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[4658871,4658870,4658869,4658868,4602029,4599809,4584074,4580823,4574784,4573907,4546420,4546409,4546240,4546223,4528085,3887679,3580503,3574922,3411661,2974530,2842852,2748827,2717082,2717075,2715904,2710285,2685471,2685274,2680174,2678023,2676541,2674471,2956794,4540232,195121,207015,110668,192681,207016,195120,110465,207014,195119,1467932,207013,195118,192680,125134,true,445,623]
#7
⏱️ 30.41 мс
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 = 2956794 THEN 3411661 WHEN sp.master_product_id = 3411661 THEN 3411661 WHEN sp.master_product_id = 4540232 THEN 4584074 WHEN sp.master_product_id = 4584074 THEN 4584074 WHEN sp.master_product_id = 195121 THEN 4658870 WHEN sp.master_product_id = 4658870 THEN 4658870 WHEN sp.master_product_id = 207015 THEN 4658870 WHEN sp.master_product_id = 110668 THEN 4658870 WHEN sp.master_product_id = 4546409 THEN 4546409 WHEN sp.master_product_id = 192681 THEN 4546409 WHEN sp.master_product_id = 4658871 THEN 4658871 WHEN sp.master_product_id = 207016 THEN 4658871 WHEN sp.master_product_id = 195120 THEN 4658871 WHEN sp.master_product_id = 110465 THEN 4658871 WHEN sp.master_product_id = 207014 THEN 4658869 WHEN sp.master_product_id = 195119 THEN 4658869 WHEN sp.master_product_id = 4658869 THEN 4658869 WHEN sp.master_product_id = 4602029 THEN 4602029 WHEN sp.master_product_id = 1467932 THEN 4602029 WHEN sp.master_product_id = 4658868 THEN 4658868 WHEN sp.master_product_id = 207013 THEN 4658868 WHEN sp.master_product_id = 195118 THEN 4658868 WHEN sp.master_product_id = 4546240 THEN 4546240 WHEN sp.master_product_id = 192680 THEN 4546240 WHEN sp.master_product_id = 2685274 THEN 2685274 WHEN sp.master_product_id = 125134 THEN 2685274 ELSE sp.master_product_id END limit 500
Bindings:
[4658871,4658870,4658869,4658868,4602029,4599809,4584074,4580823,4574784,4573907,4546420,4546409,4546240,4546223,4528085,3887679,3580503,3574922,3411661,2974530,2842852,2748827,2717082,2717075,2715904,2710285,2685471,2685274,2680174,2678023,2676541,2674471,2956794,4540232,195121,207015,110668,192681,207016,195120,110465,207014,195119,1467932,207013,195118,192680,125134,0,445,623]
#8
⏱️ 35.32 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2215535,2220220,2222733,2210873,2211840,2221519,2210459,2210175,2223210,2223441,2211310,2223899,2221343,2210491,2221585,2211799,2212009,3010023,3014842,3014853,3014889,3014891,3012930,3013642,3009170,3010313,3008953,3010625,3011100,3011101,3009757,3009756]
#9
⏱️ 18.8 мс
select * from "stores" where "stores"."id" in (445, 623)
#10
⏱️ 16.57 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["netivot"]
#11
⏱️ 15.04 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#12
⏱️ 23.85 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]