#1
⏱️ 145.78 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"dimona"]
#2
⏱️ 419.86 мс
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","fruits",127,true,127,"produce"]
#3
⏱️ 146.91 мс
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","fruits",127,true,127,"produce"]
#4
⏱️ 8.37 мс
select * from "canonical_products" where "canonical_products"."id" in (80)
#5
⏱️ 9.64 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?)
Bindings:
[80]
#6
⏱️ 26.23 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?)
Bindings:
[2257916,2190661,2151263,2136438,2045870,1879673,1453435,639411,598059,497990,496460,364725,327734,327732,311485,240947,124495,124235,110684,108505,105712,105707,105200,104329,103390,102994,102459,102205,101485,100922,100921,100819,109889,true,127]
#7
⏱️ 3.97 мс
select * from "stores" where "stores"."id" in (127)
#8
⏱️ 13.7 мс
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 = 2190661 THEN 2190661 WHEN sp.master_product_id = 109889 THEN 2190661 ELSE sp.master_product_id END limit 500
Bindings:
[2257916,2190661,2151263,2136438,2045870,1879673,1453435,639411,598059,497990,496460,364725,327734,327732,311485,240947,124495,124235,110684,108505,105712,105707,105200,104329,103390,102994,102459,102205,101485,100922,100921,100819,109889,0,127]
#9
⏱️ 10.98 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6218811,6218928,6218929,6220557,6203768,6205259,6207159,6209611,6211254,6212698,6212704,6220188,6214119,7747110,6215698,6205228,6211194,6211156,6205230,6205242,6205243,80228558]
#10
⏱️ 3.32 мс
select * from "stores" where "stores"."id" in (127)
#11
⏱️ 6.52 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["dimona"]
#12
⏱️ 8.27 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 6.02 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]