#1
⏱️ 59.6 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"modiin"]
#2
⏱️ 316.53 мс
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",713,763,111,345,1153,1201,1255,1273,40,426,439,549,406,147,305,348,true,713,763,111,345,1153,1201,1255,1273,40,426,439,549,406,147,305,348,"produce"]
#3
⏱️ 332.59 мс
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",713,763,111,345,1153,1201,1255,1273,40,426,439,549,406,147,305,348,true,713,763,111,345,1153,1201,1255,1273,40,426,439,549,406,147,305,348,"produce"]
#4
⏱️ 7.26 мс
select * from "canonical_products" where "canonical_products"."id" in (28, 139)
#5
⏱️ 10.18 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?)
Bindings:
[28,139]
#6
⏱️ 149.13 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8506300,7454739,6744655,6708345,4991109,4991108,4991102,4991097,4991094,4990825,4990456,4989961,4989777,4989772,4989767,4988403,4987625,4987431,4987210,4987154,4986799,4986761,4986606,4986526,4986335,4986312,4986299,4986270,4985768,4985115,4984967,4984753,95625,190924,622184,3619438,154941,97843,96458,133472,2712622,true,713,763,111,345,1153,1201,1255,1273,40,426,439,549,406,147,305,348]
#7
⏱️ 3.65 мс
select * from "stores" where "stores"."id" in (111, 147, 305, 345, 348, 406)
#8
⏱️ 15.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 = 95625 THEN 8506300 WHEN sp.master_product_id = 190924 THEN 8506300 WHEN sp.master_product_id = 622184 THEN 8506300 WHEN sp.master_product_id = 8506300 THEN 8506300 WHEN sp.master_product_id = 3619438 THEN 8506300 WHEN sp.master_product_id = 154941 THEN 8506300 WHEN sp.master_product_id = 97843 THEN 8506300 WHEN sp.master_product_id = 7454739 THEN 7454739 WHEN sp.master_product_id = 96458 THEN 7454739 WHEN sp.master_product_id = 133472 THEN 7454739 WHEN sp.master_product_id = 2712622 THEN 7454739 ELSE sp.master_product_id END limit 500
Bindings:
[8506300,7454739,6744655,6708345,4991109,4991108,4991102,4991097,4991094,4990825,4990456,4989961,4989777,4989772,4989767,4988403,4987625,4987431,4987210,4987154,4986799,4986761,4986606,4986526,4986335,4986312,4986299,4986270,4985768,4985115,4984967,4984753,95625,190924,622184,3619438,154941,97843,96458,133472,2712622,0,713,763,111,345,1153,1201,1255,1273,40,426,439,549,406,147,305,348]
#9
⏱️ 19.88 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6533479,5080374,5077017,5555201,5552698,746981,746270,1112490,1111387,1469947,1469107,10407009,10402204,1898716,10786395,10775095,2148450,3499395,12386758,12386972,12387120,12387778,12388280,12388309,12388322,12388345,12388536,12388616,12388772,12388810,12389165,12389221,12389442,12389636,12390416,12391782,12391787,12391792,12391976,12392471,12392842,12393097,12393100,12393105,12393111,12393112,2723836,499327,498526]
#10
⏱️ 3.59 мс
select * from "stores" where "stores"."id" in (111, 147, 305, 345, 348, 406, 426, 439, 549, 713, 763)
#11
⏱️ 5.64 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["modiin"]
#12
⏱️ 1.59 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 5.35 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]