#2
⏱️ 2044.2 мс
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","sauces_oils",462,470,521,true,462,470,521]
#3
⏱️ 150.97 мс
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","sauces_oils",462,470,521,true,462,470,521]
#6
⏱️ 3.55 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?)
Bindings:
[75165094,8775770,3931378,3742610,2991635,2953667,2811192,2807243,2752605,2702263,2671353,2669776,2658241,2657764,2644148,2632495,2631542,1972068,1462617,1458529,1458528,1458526,1456529,1451634,1429562,498260,440827,264080,257318,198431,194761,193775,98914,true,462,470,521]
#8
⏱️ 5.18 мс
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 = 98914 THEN 1458529 WHEN sp.master_product_id = 1458529 THEN 1458529 ELSE sp.master_product_id END limit 500
Bindings:
[75165094,8775770,3931378,3742610,2991635,2953667,2811192,2807243,2752605,2702263,2671353,2669776,2658241,2657764,2644148,2632495,2631542,1972068,1462617,1458529,1458528,1458526,1456529,1451634,1429562,498260,440827,264080,257318,198431,194761,193775,98914,0,462,470,521]
#9
⏱️ 21.44 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[68192641,33566197,29970112,13936591,68213263,29981051,29966376,29960449,29960507,2408597,11567337,2413666,2414706,2414137,13933613,33561947,2412355,11578244,11561443,2414358,13947352,79665348,62306275,31521201,33673044,68343728,31540238,31540237,31535941,33670090,31533774,2472501,31521549,31521651,2475516,33674400,31534993,11828251,2476281,30137269,11821703,11829863,33673013,33660924,11824701,30131789,33662131,11818048,57733039,9558333,68360,9559000,9604310]