#1
⏱️ 116.07 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"raanana"]
#2
⏱️ 404.88 мс
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",1108,762,346,1133,1198,1205,585,637,230,56,100,140,159,316,364,460,511,656,659,692,true,1108,762,346,1133,1198,1205,585,637,230,56,100,140,159,316,364,460,511,656,659,692,"produce"]
#3
⏱️ 249.98 мс
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",1108,762,346,1133,1198,1205,585,637,230,56,100,140,159,316,364,460,511,656,659,692,true,1108,762,346,1133,1198,1205,585,637,230,56,100,140,159,316,364,460,511,656,659,692,"produce"]
#4
⏱️ 20.1 мс
select * from "canonical_products" where "canonical_products"."id" in (9, 136, 199)
#5
⏱️ 8.89 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?)
Bindings:
[9,199,136]
#6
⏱️ 36.49 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4524189,4126286,4118966,4085256,4046320,4044670,4044669,4039527,4039525,3977492,3971484,3800791,2988675,2812735,2710285,2671026,2670964,2666758,2666027,2664001,1454503,1453991,703905,365009,364409,287107,287105,265106,265105,265104,255191,205837,1453310,156666,2984317,1465364,162808,1453360,112864,160598,149284,134042,109335,4019922,true,1108,762,346,1133,1198,1205,585,637,230,56,100,140,159,316,364,460,511,656,659,692]
#7
⏱️ 14.03 мс
select * from "stores" where "stores"."id" in (140)
#8
⏱️ 42.34 мс
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 = 1453310 THEN 4118966 WHEN sp.master_product_id = 156666 THEN 4118966 WHEN sp.master_product_id = 2984317 THEN 4118966 WHEN sp.master_product_id = 1465364 THEN 4118966 WHEN sp.master_product_id = 162808 THEN 4118966 WHEN sp.master_product_id = 4118966 THEN 4118966 WHEN sp.master_product_id = 1453360 THEN 4118966 WHEN sp.master_product_id = 112864 THEN 4118966 WHEN sp.master_product_id = 160598 THEN 4118966 WHEN sp.master_product_id = 3971484 THEN 3971484 WHEN sp.master_product_id = 149284 THEN 3971484 WHEN sp.master_product_id = 134042 THEN 3971484 WHEN sp.master_product_id = 109335 THEN 3971484 WHEN sp.master_product_id = 4085256 THEN 4085256 WHEN sp.master_product_id = 4019922 THEN 4085256 ELSE sp.master_product_id END limit 500
Bindings:
[4524189,4126286,4118966,4085256,4046320,4044670,4044669,4039527,4039525,3977492,3971484,3800791,2988675,2812735,2710285,2671026,2670964,2666758,2666027,2664001,1454503,1453991,703905,365009,364409,287107,287105,265106,265105,265104,255191,205837,1453310,156666,2984317,1465364,162808,1453360,112864,160598,149284,134042,109335,4019922,0,1108,762,346,1133,1198,1205,585,637,230,56,100,140,159,316,364,460,511,656,659,692]
#9
⏱️ 36.01 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5602757,5623084,5623085,5623086,5602756,5602758,5612991,5593546,919946,919947,917093,2386544,2387354,2387369,2387377,2387385,2387504,2390774,2389518,2388780,2389918,2380029,3429703,3437169,3434885,3434887,3439702,3439704,3441326,3448639,3436505,3450034,2970081,2968628,2967038,496667,493838]
#10
⏱️ 3.45 мс
select * from "stores" where "stores"."id" in (140, 230, 460, 585, 637, 762)
#11
⏱️ 12.18 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["raanana"]
#12
⏱️ 10.85 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 13.5 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]