#1
⏱️ 207.91 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"raanana"]
#2
⏱️ 624.72 мс
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","vegetables",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
⏱️ 422.74 мс
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","vegetables",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
⏱️ 18.79 мс
select * from "canonical_products" where "canonical_products"."id" in (75, 90, 281, 294, 296)
#5
⏱️ 12.66 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?)
Bindings:
[281,75,90,296,294]
#6
⏱️ 63.63 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[7065236,6744655,6708345,4844233,4841277,4665520,4584074,4528085,4122596,4118979,4118978,4116124,4109280,4097824,4054428,4047733,4047728,4039359,4025480,4012164,4004803,3996093,3991036,3986018,3982444,3979153,3978860,3977496,3977494,3970740,3803064,3802562,4540232,129463,205836,1458061,1909941,112818,1930007,127440,195115,2933336,154970,true,1108,762,346,1133,1198,1205,585,637,230,56,100,140,159,316,364,460,511,656,659,692]
#7
⏱️ 31.54 мс
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 = 4540232 THEN 4584074 WHEN sp.master_product_id = 4584074 THEN 4584074 WHEN sp.master_product_id = 129463 THEN 4039359 WHEN sp.master_product_id = 205836 THEN 4039359 WHEN sp.master_product_id = 1458061 THEN 4039359 WHEN sp.master_product_id = 4039359 THEN 4039359 WHEN sp.master_product_id = 1909941 THEN 4039359 WHEN sp.master_product_id = 112818 THEN 4039359 WHEN sp.master_product_id = 1930007 THEN 4039359 WHEN sp.master_product_id = 127440 THEN 4039359 WHEN sp.master_product_id = 4665520 THEN 4665520 WHEN sp.master_product_id = 195115 THEN 4665520 WHEN sp.master_product_id = 2933336 THEN 3802562 WHEN sp.master_product_id = 3802562 THEN 3802562 WHEN sp.master_product_id = 3803064 THEN 3803064 WHEN sp.master_product_id = 154970 THEN 3803064 ELSE sp.master_product_id END limit 500
Bindings:
[7065236,6744655,6708345,4844233,4841277,4665520,4584074,4528085,4122596,4118979,4118978,4116124,4109280,4097824,4054428,4047733,4047728,4039359,4025480,4012164,4004803,3996093,3991036,3986018,3982444,3979153,3978860,3977496,3977494,3970740,3803064,3802562,4540232,129463,205836,1458061,1909941,112818,1930007,127440,195115,2933336,154970,0,1108,762,346,1133,1198,1205,585,637,230,56,100,140,159,316,364,460,511,656,659,692]
#8
⏱️ 45.23 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2379656,2380151,2389251,2388463,2380134,2380915,3430218,3437171,3437173,3439473,3440109,3444928,3449802,3433624,3439564,3429834,3444641,3441166,3434732,3442659,3442664,3448809,3441885,3433046,3439889,3442745,3442746,3446356,2970080,2969810,2970163,2967204,2967842,2970807]
#9
⏱️ 12.75 мс
select * from "stores" where "stores"."id" in (460, 585, 637)
#10
⏱️ 12.14 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["raanana"]
#11
⏱️ 12.45 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#12
⏱️ 11.26 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]