#1
⏱️ 155.95 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"tiberias"]
#2
⏱️ 374.95 мс
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","vegetables",756,633,true,756,633,"produce"]
#3
⏱️ 226.24 мс
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","vegetables",756,633,true,756,633,"produce"]
#4
⏱️ 8.07 мс
select * from "canonical_products" where "canonical_products"."id" in (18, 48, 75, 105, 117, 174, 175, 247, 254, 283, 322)
#5
⏱️ 12.66 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[75,117,283,174,175,48,105,254,18,247,322]
#6
⏱️ 11.32 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[4584074,4546386,4546366,4546334,4546323,4546313,4546274,4546253,4546244,4541685,4541684,4528085,2903796,2896664,2685471,2678023,2672991,2671354,2671017,2671000,2670979,2670978,2670972,2663549,2662892,2662633,2661254,2658241,2634528,2631143,2630254,2630188,193200,133500,194993,1959667,154945,109696,193908,4540232,1456443,246685,95630,109897,100698,97366,111087,164587,9960259,4016585,149368,2663583,198954,198955,126588,149383,2680729,109373,true,756,633]
#7
⏱️ 24.87 мс
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 = 193200 THEN 2662633 WHEN sp.master_product_id = 2662633 THEN 2662633 WHEN sp.master_product_id = 133500 THEN 2903796 WHEN sp.master_product_id = 2903796 THEN 2903796 WHEN sp.master_product_id = 194993 THEN 2903796 WHEN sp.master_product_id = 1959667 THEN 2903796 WHEN sp.master_product_id = 154945 THEN 2903796 WHEN sp.master_product_id = 109696 THEN 2903796 WHEN sp.master_product_id = 193908 THEN 2903796 WHEN sp.master_product_id = 4540232 THEN 4584074 WHEN sp.master_product_id = 4584074 THEN 4584074 WHEN sp.master_product_id = 1456443 THEN 2896664 WHEN sp.master_product_id = 246685 THEN 2896664 WHEN sp.master_product_id = 2896664 THEN 2896664 WHEN sp.master_product_id = 95630 THEN 2896664 WHEN sp.master_product_id = 109897 THEN 2896664 WHEN sp.master_product_id = 100698 THEN 2896664 WHEN sp.master_product_id = 97366 THEN 2896664 WHEN sp.master_product_id = 111087 THEN 2896664 WHEN sp.master_product_id = 164587 THEN 2896664 WHEN sp.master_product_id = 9960259 THEN 4546323 WHEN sp.master_product_id = 4546323 THEN 4546323 WHEN sp.master_product_id = 4016585 THEN 4546323 WHEN sp.master_product_id = 149368 THEN 4546323 WHEN sp.master_product_id = 2663583 THEN 4546323 WHEN sp.master_product_id = 198954 THEN 4541685 WHEN sp.master_product_id = 4541685 THEN 4541685 WHEN sp.master_product_id = 4541684 THEN 4541684 WHEN sp.master_product_id = 198955 THEN 4541684 WHEN sp.master_product_id = 2630254 THEN 2630254 WHEN sp.master_product_id = 126588 THEN 2630254 WHEN sp.master_product_id = 149383 THEN 2662892 WHEN sp.master_product_id = 2662892 THEN 2662892 WHEN sp.master_product_id = 2680729 THEN 4546313 WHEN sp.master_product_id = 4546313 THEN 4546313 WHEN sp.master_product_id = 2630188 THEN 2630188 WHEN sp.master_product_id = 109373 THEN 2630188 ELSE sp.master_product_id END limit 500
Bindings:
[4584074,4546386,4546366,4546334,4546323,4546313,4546274,4546253,4546244,4541685,4541684,4528085,2903796,2896664,2685471,2678023,2672991,2671354,2671017,2671000,2670979,2670978,2670972,2663549,2662892,2662633,2661254,2658241,2634528,2631143,2630254,2630188,193200,133500,194993,1959667,154945,109696,193908,4540232,1456443,246685,95630,109897,100698,97366,111087,164587,9960259,4016585,149368,2663583,198954,198955,126588,149383,2680729,109373,0,756,633]
#8
⏱️ 22.87 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2959268,2959826,2960266,2961913,2961914,2966086,2966095,2966114,2966152,2966163,2966174,2966202,2966216,2960664,1814189,1807010,1805516,1812854,1818385,1807758,1815515,1816290,1816956,1817042,1817050,1817052,1817071,1817087,1817328,1809765,1818296,1817439,1814644,1808684,1817036,1815553]
#9
⏱️ 15.57 мс
select * from "stores" where "stores"."id" in (633, 756)
#10
⏱️ 8.14 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["tiberias"]
#11
⏱️ 9.61 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#12
⏱️ 16.25 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]