#1
⏱️ 115.88 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"ariel"]
#2
⏱️ 446.05 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_slug" = ? and "master_products"."id" in ((select "master_product_id" from "store_prices" where "store_id" in (?, ?, ?, ?)) union (select "master_product_id" from "deals" where "is_active" = ? and "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",162,228,464,263,true,162,228,464,263,"produce"]
#3
⏱️ 462.76 мс
select * from "master_products" where "barcode" is not null and "category_slug" = ? and "master_products"."id" in ((select "master_product_id" from "store_prices" where "store_id" in (?, ?, ?, ?)) union (select "master_product_id" from "deals" where "is_active" = ? and "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",162,228,464,263,true,162,228,464,263,"produce"]
#4
⏱️ 4.73 мс
select * from "canonical_products" where "canonical_products"."id" in (38, 78, 170, 176, 192, 247, 271, 288, 322)
#5
⏱️ 3.25 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[192,176,170,38,78,271,247,322,288]
#6
⏱️ 5.53 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[3864304,3862499,3677696,3385632,3084365,3068182,3067885,2715904,2682071,2681776,2681555,2672991,2664339,2658241,2647242,2642320,2636398,2634528,2633252,2632033,2631970,2631143,2630254,2630188,1480473,1472828,1454503,1453854,1439039,1439037,1436463,1435142,2672969,2672977,1453321,156941,158420,750862,190887,109029,150733,133502,126102,126588,122818,96500,109373,true,162,228,464,263]
#7
⏱️ 3.02 мс
select * from "stores" where "stores"."id" in (228, 263)
#8
⏱️ 7.43 мс
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 = 2681555 THEN 2681555 WHEN sp.master_product_id = 2672969 THEN 2681555 WHEN sp.master_product_id = 2672977 THEN 2681555 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 = 3067885 THEN 3067885 WHEN sp.master_product_id = 750862 THEN 3067885 WHEN sp.master_product_id = 190887 THEN 3067885 WHEN sp.master_product_id = 109029 THEN 3067885 WHEN sp.master_product_id = 150733 THEN 3067885 WHEN sp.master_product_id = 3068182 THEN 3068182 WHEN sp.master_product_id = 133502 THEN 3068182 WHEN sp.master_product_id = 126102 THEN 3084365 WHEN sp.master_product_id = 3084365 THEN 3084365 WHEN sp.master_product_id = 2630254 THEN 2630254 WHEN sp.master_product_id = 126588 THEN 2630254 WHEN sp.master_product_id = 2633252 THEN 2633252 WHEN sp.master_product_id = 122818 THEN 2633252 WHEN sp.master_product_id = 1453854 THEN 1453854 WHEN sp.master_product_id = 96500 THEN 1453854 WHEN sp.master_product_id = 2630188 THEN 2630188 WHEN sp.master_product_id = 109373 THEN 2630188 ELSE sp.master_product_id END limit 500
Bindings:
[3864304,3862499,3677696,3385632,3084365,3068182,3067885,2715904,2682071,2681776,2681555,2672991,2664339,2658241,2647242,2642320,2636398,2634528,2633252,2632033,2631970,2631143,2630254,2630188,1480473,1472828,1454503,1453854,1439039,1439037,1436463,1435142,2672969,2672977,1453321,156941,158420,750862,190887,109029,150733,133502,126102,126588,122818,96500,109373,0,162,228,464,263]
#9
⏱️ 17.67 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[5947192,5960797,5960800,5960798,5008675,5022675,5022677,798825,5017349,5022676,2434893,2428234,2428219,2428216,2433710,2427466,2427487,2427528,2427485,2433724,2434369,2427499,2434164,2432143,2430977,2430970,2430971,2428716,2430965,2433689,2427434,2429285,2430972,2430307,2428745,2430308]
#10
⏱️ 5.98 мс
select * from "stores" where "stores"."id" in (228, 263, 464)
#11
⏱️ 12.79 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["ariel"]
#12
⏱️ 6.8 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 10.94 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]