#1
⏱️ 138.12 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"ariel"]
#2
⏱️ 233.75 мс
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",162,228,464,263,true,162,228,464,263,"produce"]
#3
⏱️ 209.79 мс
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",162,228,464,263,true,162,228,464,263,"produce"]
#4
⏱️ 6.38 мс
select * from "canonical_products" where "canonical_products"."id" in (78, 321, 330)
#5
⏱️ 4.88 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?)
Bindings:
[78,330,321]
#6
⏱️ 14.82 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[2715904,2682071,2647242,2632033,2631970,1480473,1472828,1439039,1439037,1436463,1435142,1428126,1428121,1425641,1333076,261083,245269,156089,135622,134159,134109,134051,133579,133578,133570,133557,133555,133545,133533,133530,133508,133499,1453321,156941,158420,109654,109659,true,162,228,464,263]
#7
⏱️ 6.23 мс
select * from "stores" where "stores"."id" in (228, 263)
#8
⏱️ 14.96 мс
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 = 1453321 THEN 2647242 WHEN sp.master_product_id = 2647242 THEN 2647242 WHEN sp.master_product_id = 156941 THEN 2647242 WHEN sp.master_product_id = 158420 THEN 2647242 WHEN sp.master_product_id = 133530 THEN 133530 WHEN sp.master_product_id = 109654 THEN 133530 WHEN sp.master_product_id = 109659 THEN 133545 WHEN sp.master_product_id = 133545 THEN 133545 ELSE sp.master_product_id END limit 500
Bindings:
[2715904,2682071,2647242,2632033,2631970,1480473,1472828,1439039,1439037,1436463,1435142,1428126,1428121,1425641,1333076,261083,245269,156089,135622,134159,134109,134051,133579,133578,133570,133557,133555,133545,133533,133530,133508,133499,1453321,156941,158420,109654,109659,0,162,228,464,263]
#9
⏱️ 11.15 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5947490,5939986,5952160,5952170,5947192,5960797,5960800,5960798,5014225,801959,798651,5008690,5014372,5017543,5017552,5008675,5022675,5022677,5017349,5022676,2427431,2427436,2427456,2427459,2427473,2427484,2427490,2427505,2427517,2427525,2436241,2427772,2431370,2436189,2429063,2427466,2427487,2427499,2428716,2430965]
#10
⏱️ 12.37 мс
select * from "stores" where "stores"."id" in (228, 263, 464)
#11
⏱️ 2.99 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["ariel"]
#12
⏱️ 1.37 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 1.57 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]