#2
⏱️ 517.14 мс
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 (?, ?, ?)))
Bindings:
["grocery","baking_spices",462,470,521,true,462,470,521]
#3
⏱️ 303.15 мс
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 (?, ?, ?))) 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:
["grocery","baking_spices",462,470,521,true,462,470,521]
#6
⏱️ 25.11 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?)
Bindings:
[2975340,2842852,2702452,2680174,2670979,2666027,2663549,2640775,2640774,2608194,1469150,1457784,1455751,1455745,1455741,1451848,1451847,1451739,704477,685427,364789,274786,256300,198874,195457,175170,175169,171783,168019,164080,162330,161333,1909143,true,462,470,521]
#8
⏱️ 50.21 мс
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 = 1909143 THEN 198874 WHEN sp.master_product_id = 198874 THEN 198874 ELSE sp.master_product_id END limit 500
Bindings:
[2975340,2842852,2702452,2680174,2670979,2666027,2663549,2640775,2640774,2608194,1469150,1457784,1455751,1455745,1455741,1451848,1451847,1451739,704477,685427,364789,274786,256300,198874,195457,175170,175169,171783,168019,164080,162330,161333,1909143,0,462,470,521]
#9
⏱️ 65.23 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2414920,2411869,11585948,11585949,11573467,29966416,11571926,2409054,13927138,68199054,29981096,68211202,68195549,68195553,11579406,68213252,11576474,2412265,11560175,11560345,11581169,11553917,13962343,11558427,2413194,11548356,68198912,11821916,30139275,2474226,33670399,11823413,79753463,31522332,56492683,2474501,2473929,56500551,11814679,31522031,31534058,31534059,2472489,2472491,2474913,2476722,11839553,33661806,11826882,31521689,31521928,9579700]