#1
⏱️ 56.9 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"maale-adumim"]
#2
⏱️ 810.65 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_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",262,1265,128,true,262,1265,128,"produce"]
#3
⏱️ 246.9 мс
select * from "master_products" where "barcode" is not null and "category_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",262,1265,128,true,262,1265,128,"produce"]
#4
⏱️ 7.38 мс
select * from "canonical_products" where "canonical_products"."id" in (79, 80, 82, 111, 266)
#5
⏱️ 2.57 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?)
Bindings:
[111,80,79,266,82]
#6
⏱️ 15.47 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?)
Bindings:
[2257916,2257475,2190661,2190128,2151263,2136438,2045870,1879673,1879254,1453435,1088015,959071,925036,925028,682290,639411,598059,499851,497990,496502,496460,483766,471051,438378,438372,409780,409469,365009,365008,364725,364409,364407,97564,109889,109243,134681,150736,190899,703893,364246,true,262,1265,128]
#7
⏱️ 10.61 мс
select * from "stores" where "stores"."id" in (128)
#8
⏱️ 9.06 мс
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 = 2190128 THEN 2190128 WHEN sp.master_product_id = 97564 THEN 2190128 WHEN sp.master_product_id = 2190661 THEN 2190661 WHEN sp.master_product_id = 109889 THEN 2190661 WHEN sp.master_product_id = 109243 THEN 496502 WHEN sp.master_product_id = 496502 THEN 496502 WHEN sp.master_product_id = 134681 THEN 496502 WHEN sp.master_product_id = 150736 THEN 496502 WHEN sp.master_product_id = 190899 THEN 496502 WHEN sp.master_product_id = 703893 THEN 2257475 WHEN sp.master_product_id = 2257475 THEN 2257475 WHEN sp.master_product_id = 364246 THEN 959071 WHEN sp.master_product_id = 959071 THEN 959071 ELSE sp.master_product_id END limit 500
Bindings:
[2257916,2257475,2190661,2190128,2151263,2136438,2045870,1879673,1879254,1453435,1088015,959071,925036,925028,682290,639411,598059,499851,497990,496502,496460,483766,471051,438378,438372,409780,409469,365009,365008,364725,364409,364407,97564,109889,109243,134681,150736,190899,703893,364246,0,262,1265,128]
#9
⏱️ 14.58 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6187072,6187074,6188487,6188820,6188821,6187082,6188486,6191598,6191603,6184146,6188415,6196030,6180772,6180825,6191608,6191614,6186892,6200462,6180785,6178038,6180786,6185626,80222068,955246,955647,955442,953163,957278,953757,955004]
#10
⏱️ 9.86 мс
select * from "stores" where "stores"."id" in (128, 262)
#11
⏱️ 7.65 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["maale-adumim"]
#12
⏱️ 7.49 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 5.32 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]