#1
⏱️ 113.75 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"akko"]
#2
⏱️ 311.45 мс
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",221,11,442,686,1368,true,221,11,442,686,1368,"produce"]
#3
⏱️ 202.31 мс
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",221,11,442,686,1368,true,221,11,442,686,1368,"produce"]
#4
⏱️ 5.1 мс
select * from "canonical_products" where "canonical_products"."id" in (30, 182, 187)
#5
⏱️ 5.52 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?)
Bindings:
[182,30,187]
#6
⏱️ 12.63 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?)
Bindings:
[2996211,2975219,2715904,2682071,2681942,2680174,2671011,2670954,2670949,2670946,2666943,2666106,2662799,2662570,2662130,2633336,2632033,2631970,2046307,1911330,1515272,1472828,1458526,1457611,1457103,1455999,1455743,1453979,1453435,1439039,1439038,1439037,1933366,1960939,10941098,true,221,11,442,686,1368]
#7
⏱️ 6.86 мс
select * from "stores" where "stores"."id" in (11, 221)
#8
⏱️ 18.13 мс
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 = 1933366 THEN 2670949 WHEN sp.master_product_id = 2670949 THEN 2670949 WHEN sp.master_product_id = 2681942 THEN 2681942 WHEN sp.master_product_id = 1960939 THEN 2681942 WHEN sp.master_product_id = 2666943 THEN 2666943 WHEN sp.master_product_id = 10941098 THEN 2666943 ELSE sp.master_product_id END limit 500
Bindings:
[2996211,2975219,2715904,2682071,2681942,2680174,2671011,2670954,2670949,2670946,2666943,2666106,2662799,2662570,2662130,2633336,2632033,2631970,2046307,1911330,1515272,1472828,1458526,1457611,1457103,1455999,1455743,1453979,1453435,1439039,1439038,1439037,1933366,1960939,10941098,0,221,11,442,686,1368]
#9
⏱️ 25.25 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1589657,1589658,1589659,6106889,2195009,2195071,2195114,2192002,2191198,2181511,2182252,2187952,2188980,2183554,2183573,2187469,2188105,2188419,2188726,2188484,2193345,2194624,2194698,2180855,2193257,2188562,2183594,2181671,2182790,2181449,2193267]
#10
⏱️ 9.34 мс
select * from "stores" where "stores"."id" in (11, 221, 442)
#11
⏱️ 8.8 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["akko"]
#12
⏱️ 9.23 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 7.23 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]