#2
⏱️ 1100 мс
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",730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298,true,730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298]
#3
⏱️ 533.93 мс
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",730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298,true,730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298]
#6
⏱️ 13.61 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[7518269,7441737,3458976,3230535,2842852,2702452,2680174,2670979,2666098,2666027,2663549,2640775,2640774,2608194,1959857,1908616,1908615,1474523,1472108,1469150,1465150,1457784,1455751,1455745,1455741,1455708,1455705,1455698,1455697,1451848,1451847,1451739,130435,97793,100585,true,730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298]
#8
⏱️ 11.46 мс
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 = 1465150 THEN 1465150 WHEN sp.master_product_id = 130435 THEN 1465150 WHEN sp.master_product_id = 1455697 THEN 1455697 WHEN sp.master_product_id = 97793 THEN 1455697 WHEN sp.master_product_id = 100585 THEN 1455697 ELSE sp.master_product_id END limit 500
Bindings:
[7518269,7441737,3458976,3230535,2842852,2702452,2680174,2670979,2666098,2666027,2663549,2640775,2640774,2608194,1959857,1908616,1908615,1474523,1472108,1469150,1465150,1457784,1455751,1455745,1455741,1455708,1455705,1455698,1455697,1451848,1451847,1451739,130435,97793,100585,0,730,748,288,45,80,135,163,432,477,502,682,84,86,217,265,282,285,298]
#9
⏱️ 6.14 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[4754840,4754906,4754907,4763659,4763661,4763680,4763684,4763687,4766393,4709677,4715913,4715915,4715919,4715923,4718438,4718442,4718446,4721593,5896381,6175661,4800225,5575379,5587821,5587823,5587831,5587853,5587857,5587862,5592203,5585891,5585202,5585203,5580540,654591,5485868,5485872,5485894,5485898,5485903,5491058,5485744,5483428,5483429,5237560,5237658,5247187,5247189,5247196,5247201,5247220,5247224,5247228,5254383,5247043,5244705,5244706,4904279,2052256,2045354,2046846,2045640,2045689,2048222,2049572,2053176,2047619,2043325,29420029,33192397,12019208,12019210,12026967,2510613,12016498,90059176,31651963,90080213,90090904,2511260,90077374,33763636,30366567,2602108,90804168,30364459,30364460,90780433,19027698,1705474,1705478,1705484,32868818,1701973,6748148,6758825,1698266,1698754,1703011,1705296,6748651,29096818,1702250,29088876]