#1
⏱️ 114.68 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"kfar-saba"]
#2
⏱️ 337.73 мс
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",740,222,392,295,1124,1138,1226,1238,584,317,354,368,25,50,141,194,254,249,302,329,478,498,556,true,740,222,392,295,1124,1138,1226,1238,584,317,354,368,25,50,141,194,254,249,302,329,478,498,556,"produce"]
#3
⏱️ 250.5 мс
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",740,222,392,295,1124,1138,1226,1238,584,317,354,368,25,50,141,194,254,249,302,329,478,498,556,true,740,222,392,295,1124,1138,1226,1238,584,317,354,368,25,50,141,194,254,249,302,329,478,498,556,"produce"]
#4
⏱️ 16.39 мс
select * from "canonical_products" where "canonical_products"."id" in (79, 111, 199, 215)
#5
⏱️ 6.14 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?)
Bindings:
[199,215,111,79]
#6
⏱️ 398.13 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,7466366,4094723,4093867,4085256,4064694,4044670,4044669,4039527,4039525,4020207,3977492,2931321,2812350,2647878,2641760,2606604,2604820,2257475,2190128,1962114,1961878,1455907,1454931,1454926,1454900,992455,97564,703893,4019922,112366,true,740,222,392,295,1124,1138,1226,1238,584,317,354,368,25,50,141,194,254,249,302,329,478,498,556]
#7
⏱️ 11.12 мс
select * from "stores" where "stores"."id" in (25, 141, 329, 392, 740)
#8
⏱️ 24.22 мс
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 = 703893 THEN 2257475 WHEN sp.master_product_id = 2257475 THEN 2257475 WHEN sp.master_product_id = 4085256 THEN 4085256 WHEN sp.master_product_id = 4019922 THEN 4085256 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,7466366,4094723,4093867,4085256,4064694,4044670,4044669,4039527,4039525,4020207,3977492,2931321,2812350,2647878,2641760,2606604,2604820,2257475,2190128,1962114,1961878,1455907,1454931,1454926,1454900,992455,97564,703893,4019922,112366,0,740,222,392,295,1124,1138,1226,1238,584,317,354,368,25,50,141,194,254,249,302,329,478,498,556]
#9
⏱️ 27.42 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1225444,5561548,663074,1022693,4636222,1141984,1138483,1186106,1363174,2515196,2515104,2581380,2581929,3573054,3572993,3417247,3415070,3415056,3415058,3419731,3419733,3417120,3427972,3417680,3418534,3946751]
#10
⏱️ 7.41 мс
select * from "stores" where "stores"."id" in (25, 141, 295, 317, 329, 354, 368, 392, 478, 498, 556, 584, 740)
#11
⏱️ 4.57 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["kfar-saba"]
#12
⏱️ 12.84 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 16.83 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]