#2
⏱️ 3373.84 мс
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 (?, ?, ?, ?)))
Bindings:
["grocery",742,273,479,24,true,742,273,479,24]
#3
⏱️ 3426.7 мс
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 (?, ?, ?, ?))) 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",742,273,479,24,true,742,273,479,24]
#4
⏱️ 39.98 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?)
Bindings:
[8775770,8775716,7452547,7443308,7443245,7440957,7065236,6745776,6730411,4987518,4012164,3646497,2807243,2752605,2702255,2674471,2658241,2645643,2640775,2603784,2037598,1919768,1919767,1918295,1913217,1913216,1912286,1912018,1911972,1910474,1909890,1909366,true,742,273,479,24]
#6
⏱️ 17.77 мс
select * from "store_prices" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "price" > ? and "store_id" in (?, ?, ?, ?)
Bindings:
[8775770,8775716,7452547,7443308,7443245,7440957,7065236,6745776,6730411,4987518,4012164,3646497,2807243,2752605,2702255,2674471,2658241,2645643,2640775,2603784,2037598,1919768,1919767,1918295,1913217,1913216,1912286,1912018,1911972,1910474,1909890,1909366,0,742,273,479,24]