#1
⏱️ 127.06 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"safed"]
#2
⏱️ 147.51 мс
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",101,275,true,101,275,"produce"]
#3
⏱️ 88.2 мс
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",101,275,true,101,275,"produce"]
#4
⏱️ 5.29 мс
select * from "canonical_products" where "canonical_products"."id" in (121, 183)
#5
⏱️ 4.96 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?)
Bindings:
[121,183]
#6
⏱️ 5.9 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[1962114,1912369,1912088,1912087,1912003,1910399,1909142,1456754,1455921,1455918,1455917,1455912,1455910,1455909,1455908,1455907,1455663,1455659,1454931,1454930,1454929,1454928,1454927,1454926,1454923,1454921,1454912,1454908,1453991,1453735,128513,114732,164584,1454238,true,101,275]
#7
⏱️ 4.8 мс
select * from "stores" where "stores"."id" in (101, 275)
#8
⏱️ 5.29 мс
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 ELSE sp.master_product_id END limit 500
Bindings:
[1962114,1912369,1912088,1912087,1912003,1910399,1909142,1456754,1455921,1455918,1455917,1455912,1455910,1455909,1455908,1455907,1455663,1455659,1454931,1454930,1454929,1454928,1454927,1454926,1454923,1454921,1454912,1454908,1453991,1453735,128513,114732,164584,1454238,0,101,275]
#9
⏱️ 5.38 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6218117,5388281,5378802,5378944,5381498,5381502,5381508,5381510,5381512,5381513,5381514,5381515,5381516,5381517,5384093,5384098,5384220,5384221,5384222,5384223,5384225,5384227,5384228,5384229,5386071,5384212,5390245,5400063,5400194,5400195,5400633,5388054]
#10
⏱️ 1.04 мс
select * from "stores" where "stores"."id" in (101, 275)
#11
⏱️ 4.49 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["safed"]
#12
⏱️ 10.58 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 9.26 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]