#1
⏱️ 83.13 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"raanana"]
#2
⏱️ 1463.1 мс
select count(*) as "aggregate" from "master_products" where "barcode" is not null and "category_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",1108,762,1133,1198,1205,585,637,56,100,159,460,511,656,659,692,140,230,346,316,364,true,1108,762,1133,1198,1205,585,637,56,100,159,460,511,656,659,692,140,230,346,316,364,"produce"]
#3
⏱️ 1613.85 мс
select * from "master_products" where "barcode" is not null and "category_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",1108,762,1133,1198,1205,585,637,56,100,159,460,511,656,659,692,140,230,346,316,364,true,1108,762,1133,1198,1205,585,637,56,100,159,460,511,656,659,692,140,230,346,316,364,"produce"]
#4
⏱️ 9.38 мс
select * from "canonical_products" where "canonical_products"."id" in (4, 44, 84, 139, 159, 193, 194, 238)
#5
⏱️ 3.13 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[238,4,159,194,193,84,139,44]
#6
⏱️ 106.22 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8897354,7569492,7568127,7562101,7561917,7556845,7550923,7549019,7529435,7529293,7493489,7472471,7466366,7461021,7455068,7454739,7452710,7446739,7439517,7431628,7428697,6908951,6744655,6708345,4991109,4991108,4991102,4991097,4991094,4991092,4990825,4990456,2190109,4034737,133509,1952651,160965,1454922,165505,96458,133472,2712622,195947,1941919,1456452,157276,191901,157163,112362,4029456,2317173,true,1108,762,1133,1198,1205,585,637,56,100,159,460,511,656,659,692,140,230,346,316,364]
#7
⏱️ 11.99 мс
select * from "stores" where "stores"."id" in (100, 140, 316, 346, 364)
#8
⏱️ 22.61 мс
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 = 2190109 THEN 7569492 WHEN sp.master_product_id = 4034737 THEN 7569492 WHEN sp.master_product_id = 133509 THEN 7569492 WHEN sp.master_product_id = 7569492 THEN 7569492 WHEN sp.master_product_id = 1952651 THEN 7569492 WHEN sp.master_product_id = 7428697 THEN 7428697 WHEN sp.master_product_id = 160965 THEN 7428697 WHEN sp.master_product_id = 1454922 THEN 7461021 WHEN sp.master_product_id = 7461021 THEN 7461021 WHEN sp.master_product_id = 165505 THEN 7461021 WHEN sp.master_product_id = 7454739 THEN 7454739 WHEN sp.master_product_id = 96458 THEN 7454739 WHEN sp.master_product_id = 133472 THEN 7454739 WHEN sp.master_product_id = 2712622 THEN 7454739 WHEN sp.master_product_id = 7561917 THEN 7561917 WHEN sp.master_product_id = 195947 THEN 7561917 WHEN sp.master_product_id = 1941919 THEN 7561917 WHEN sp.master_product_id = 1456452 THEN 7561917 WHEN sp.master_product_id = 157276 THEN 7561917 WHEN sp.master_product_id = 191901 THEN 7561917 WHEN sp.master_product_id = 157163 THEN 7561917 WHEN sp.master_product_id = 7529293 THEN 7529293 WHEN sp.master_product_id = 112362 THEN 7529293 WHEN sp.master_product_id = 4029456 THEN 7529435 WHEN sp.master_product_id = 7529435 THEN 7529435 WHEN sp.master_product_id = 2317173 THEN 8897354 WHEN sp.master_product_id = 8897354 THEN 8897354 ELSE sp.master_product_id END limit 500
Bindings:
[8897354,7569492,7568127,7562101,7561917,7556845,7550923,7549019,7529435,7529293,7493489,7472471,7466366,7461021,7455068,7454739,7452710,7446739,7439517,7431628,7428697,6908951,6744655,6708345,4991109,4991108,4991102,4991097,4991094,4991092,4990825,4990456,2190109,4034737,133509,1952651,160965,1454922,165505,96458,133472,2712622,195947,1941919,1456452,157276,191901,157163,112362,4029456,2317173,0,1108,762,1133,1198,1205,585,637,56,100,159,460,511,656,659,692,140,230,346,316,364]
#9
⏱️ 12.41 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4335054,5600059,915264,4934185,4949307,752621,5350834,6125037,2388463,2380134,2389084,33534889,11496832,2389113,30406745,19141706,12326102,56684343,12331529,12331593,12328110,47962821,12326958,12328073,78753640,12327418,12329162,56683839,78753683,12328964,12325043,12328957,47958855,12328065,47960512,56684624,56683286,24564367,3437099,3431133,12301713,12302582,12288726,12288728,12288731,12288736,12288742,12288743,11613636,2968008,493346]
#10
⏱️ 7.32 мс
select * from "stores" where "stores"."id" in (100, 140, 230, 316, 346, 364, 460, 511, 585, 637, 762)
#11
⏱️ 7.98 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["raanana"]
#12
⏱️ 9.15 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 9.05 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]