#1
⏱️ 119.68 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"petah-tikva"]
#2
⏱️ 307.46 мс
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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))) 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","herbs_mushrooms",18,732,750,771,190,356,1145,1211,1239,1246,1262,1306,1328,1334,324,330,391,34,35,103,146,152,174,191,216,224,276,338,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,257,308,true,18,732,750,771,190,356,1145,1211,1239,1246,1262,1306,1328,1334,324,330,391,34,35,103,146,152,174,191,216,224,276,338,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,257,308,"produce"]
#3
⏱️ 199.47 мс
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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))) 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","herbs_mushrooms",18,732,750,771,190,356,1145,1211,1239,1246,1262,1306,1328,1334,324,330,391,34,35,103,146,152,174,191,216,224,276,338,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,257,308,true,18,732,750,771,190,356,1145,1211,1239,1246,1262,1306,1328,1334,324,330,391,34,35,103,146,152,174,191,216,224,276,338,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,257,308,"produce"]
#4
⏱️ 16.17 мс
select * from "canonical_products" where "canonical_products"."id" in (5, 19, 28, 44, 84, 159, 181, 308)
#5
⏱️ 17.73 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[28,159,19,84,44,308,5,181]
#6
⏱️ 170.58 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,8506300,7568127,7565762,7561917,7557005,7466366,7461021,7428697,4991092,4989961,4987921,4987920,4987918,4987624,4987231,4986722,4986606,4986434,4985340,4984012,4983887,4983785,4983721,4983719,4983613,4681547,4983654,195114,160641,154948,363774,4042739,160958,189969,3619438,622184,190924,154941,95625,97843,160965,1454922,165505,1941919,1456452,157163,191901,195947,157276,166942,4259731,3569061,112144,155798,4525248,true,18,732,750,771,190,356,1145,1211,1239,1246,1262,1306,1328,1334,324,330,391,34,35,103,146,152,174,191,216,224,276,338,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,257,308]
#7
⏱️ 16.56 мс
select * from "stores" where "stores"."id" in (18, 34, 35, 103, 104, 146, 152, 276, 324, 330, 338, 391, 732)
#8
⏱️ 187.25 мс
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 = 4983654 THEN 4983719 WHEN sp.master_product_id = 4983719 THEN 4983719 WHEN sp.master_product_id = 195114 THEN 7557005 WHEN sp.master_product_id = 7557005 THEN 7557005 WHEN sp.master_product_id = 160641 THEN 7557005 WHEN sp.master_product_id = 154948 THEN 7557005 WHEN sp.master_product_id = 363774 THEN 7557005 WHEN sp.master_product_id = 4042739 THEN 7557005 WHEN sp.master_product_id = 160958 THEN 7557005 WHEN sp.master_product_id = 189969 THEN 7557005 WHEN sp.master_product_id = 3619438 THEN 8506300 WHEN sp.master_product_id = 8506300 THEN 8506300 WHEN sp.master_product_id = 622184 THEN 8506300 WHEN sp.master_product_id = 190924 THEN 8506300 WHEN sp.master_product_id = 154941 THEN 8506300 WHEN sp.master_product_id = 95625 THEN 8506300 WHEN sp.master_product_id = 97843 THEN 8506300 WHEN sp.master_product_id = 7428697 THEN 7428697 WHEN sp.master_product_id = 160965 THEN 7428697 WHEN sp.master_product_id = 7461021 THEN 7461021 WHEN sp.master_product_id = 1454922 THEN 7461021 WHEN sp.master_product_id = 165505 THEN 7461021 WHEN sp.master_product_id = 7561917 THEN 7561917 WHEN sp.master_product_id = 1941919 THEN 7561917 WHEN sp.master_product_id = 1456452 THEN 7561917 WHEN sp.master_product_id = 157163 THEN 7561917 WHEN sp.master_product_id = 191901 THEN 7561917 WHEN sp.master_product_id = 195947 THEN 7561917 WHEN sp.master_product_id = 157276 THEN 7561917 WHEN sp.master_product_id = 166942 THEN 4681547 WHEN sp.master_product_id = 4259731 THEN 4681547 WHEN sp.master_product_id = 3569061 THEN 4681547 WHEN sp.master_product_id = 112144 THEN 4681547 WHEN sp.master_product_id = 155798 THEN 4681547 WHEN sp.master_product_id = 4681547 THEN 4681547 WHEN sp.master_product_id = 4983721 THEN 4983721 WHEN sp.master_product_id = 4525248 THEN 4983721 ELSE sp.master_product_id END limit 500
Bindings:
[8775651,8775580,8775533,8775532,8775519,8775509,8506300,7568127,7565762,7561917,7557005,7466366,7461021,7428697,4991092,4989961,4987921,4987920,4987918,4987624,4987231,4986722,4986606,4986434,4985340,4984012,4983887,4983785,4983721,4983719,4983613,4681547,4983654,195114,160641,154948,363774,4042739,160958,189969,3619438,622184,190924,154941,95625,97843,160965,1454922,165505,1941919,1456452,157163,191901,195947,157276,166942,4259731,3569061,112144,155798,4525248,0,18,732,750,771,190,356,1145,1211,1239,1246,1262,1306,1328,1334,324,330,391,34,35,103,146,152,174,191,216,224,276,338,448,484,503,504,505,1354,553,575,579,648,655,662,681,688,689,104,257,308]
#9
⏱️ 9.3 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6058174,5530322,793518,4251012,4236759,4739002,5185203,5167294,4841747,5344733,5340205,682236,1044899,1062588,4359974,775259,1353065,2241647,2530361,2610656,2605743,2610311,2614498,2614609,2614500,2622628,2616609,2622586,2616865,3550765,3550072,3551859,3550065,3682456,3680336,3678373,3702614,3703757,3702611,4107735,3828278,282181,3125573,3125646,2768984,3125712,3125814,3125939,3127267,3128361,3128533,3128649,3129158,3129551,3129845,3129847,3129848,3131888,3133005,7710327,2767010,2769203,7705385]
#10
⏱️ 9.65 мс
select * from "stores" where "stores"."id" in (18, 34, 35, 103, 104, 146, 152, 276, 308, 324, 330, 338, 356, 391, 448, 484, 503, 504, 505, 553, 575, 579, 732, 750, 771)
#11
⏱️ 6.82 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["petah-tikva"]
#12
⏱️ 7.65 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 7.52 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]