#1
⏱️ 189.31 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"beit-shemesh"]
#2
⏱️ 249.47 мс
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","herbs_mushrooms",742,24,479,273,true,742,24,479,273,"produce"]
#3
⏱️ 137.65 мс
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","herbs_mushrooms",742,24,479,273,true,742,24,479,273,"produce"]
#4
⏱️ 9.96 мс
select * from "canonical_products" where "canonical_products"."id" in (121, 183, 215)
#5
⏱️ 5.3 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?)
Bindings:
[215,121,183]
#6
⏱️ 21.32 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,7472471,2931321,2647878,2641760,2636398,2606604,2604820,1962114,1961878,1916175,1912369,1912088,1912087,1912003,1910399,1909142,1456754,1455921,1455918,1455917,1455912,1455910,1455909,1455908,1455907,1455663,164584,1454238,112366,true,742,24,479,273]
#7
⏱️ 6.7 мс
select * from "stores" where "stores"."id" in (273, 742)
#8
⏱️ 13.57 мс
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 = 1910399 THEN 1910399 WHEN sp.master_product_id = 164584 THEN 1910399 WHEN sp.master_product_id = 1455921 THEN 1455921 WHEN sp.master_product_id = 1454238 THEN 1455921 WHEN sp.master_product_id = 112366 THEN 2604820 WHEN sp.master_product_id = 2604820 THEN 2604820 ELSE sp.master_product_id END limit 500
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,7472471,2931321,2647878,2641760,2636398,2606604,2604820,1962114,1961878,1916175,1912369,1912088,1912087,1912003,1910399,1909142,1456754,1455921,1455918,1455917,1455912,1455910,1455909,1455908,1455907,1455663,164584,1454238,112366,0,742,24,479,273]
#9
⏱️ 13.41 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5756062,5756163,5756164,5756165,5756166,5756168,5756172,5756173,5756174,5758722,5756157,5763813,5770512,5770592,5770593,5772903,5761462,5758714,2522027,2520723,2520745,2521209,3946753]
#10
⏱️ 4.45 мс
select * from "stores" where "stores"."id" in (273, 479, 742)
#11
⏱️ 8.68 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["beit-shemesh"]
#12
⏱️ 7.69 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 16.96 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]