#1
⏱️ 85.31 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"tiberias"]
#2
⏱️ 172.34 мс
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","fruits",756,633,true,756,633,"produce"]
#3
⏱️ 72.49 мс
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","fruits",756,633,true,756,633,"produce"]
#4
⏱️ 4.21 мс
select * from "canonical_products" where "canonical_products"."id" in (30, 78, 81, 126, 129, 187, 275, 320)
#5
⏱️ 2.73 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[126,81,320,275,129,30,187,78]
#6
⏱️ 2.84 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?)
Bindings:
[4834493,4834331,4546420,4546409,4546368,4546345,4546240,4546223,4546198,4539975,4534927,4524191,2680174,2671353,2671011,2670954,2670949,2670946,2668399,2666943,2662799,2662570,2662130,2647242,2634735,2632033,2631970,1515272,1457611,207158,200405,199831,1933366,1453321,156941,158420,3053377,1452602,2670953,4033131,192681,1907955,133473,109566,190782,10941098,2663682,1059071,192680,true,756,633]
#7
⏱️ 7.81 мс
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 = 1933366 THEN 2670949 WHEN sp.master_product_id = 2670949 THEN 2670949 WHEN sp.master_product_id = 1453321 THEN 2647242 WHEN sp.master_product_id = 2647242 THEN 2647242 WHEN sp.master_product_id = 156941 THEN 2647242 WHEN sp.master_product_id = 158420 THEN 2647242 WHEN sp.master_product_id = 3053377 THEN 4546368 WHEN sp.master_product_id = 1452602 THEN 4546368 WHEN sp.master_product_id = 2670953 THEN 4546368 WHEN sp.master_product_id = 4546368 THEN 4546368 WHEN sp.master_product_id = 4033131 THEN 4546368 WHEN sp.master_product_id = 4546409 THEN 4546409 WHEN sp.master_product_id = 192681 THEN 4546409 WHEN sp.master_product_id = 1907955 THEN 4524191 WHEN sp.master_product_id = 4524191 THEN 4524191 WHEN sp.master_product_id = 133473 THEN 4524191 WHEN sp.master_product_id = 109566 THEN 4524191 WHEN sp.master_product_id = 190782 THEN 4524191 WHEN sp.master_product_id = 2666943 THEN 2666943 WHEN sp.master_product_id = 10941098 THEN 2666943 WHEN sp.master_product_id = 2663682 THEN 4534927 WHEN sp.master_product_id = 1059071 THEN 4534927 WHEN sp.master_product_id = 4534927 THEN 4534927 WHEN sp.master_product_id = 4546240 THEN 4546240 WHEN sp.master_product_id = 192680 THEN 4546240 ELSE sp.master_product_id END limit 500
Bindings:
[4834493,4834331,4546420,4546409,4546368,4546345,4546240,4546223,4546198,4539975,4534927,4524191,2680174,2671353,2671011,2670954,2670949,2670946,2668399,2666943,2662799,2662570,2662130,2647242,2634735,2632033,2631970,1515272,1457611,207158,200405,199831,1933366,1453321,156941,158420,3053377,1452602,2670953,4033131,192681,1907955,133473,109566,190782,10941098,2663682,1059071,192680,0,756,633]
#8
⏱️ 4.69 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2965396,2965994,2961850,2961769,2956968,2955856,2960444,2966058,2966065,2966082,2966184,2966204,2966229,2966237,2960875,2961038,1808566,1811110,1813900,1813917,1807185,1813925,1814298,1815226,1816164,1817004,1813932,1817015,1817018,1817023,1817082,1817327,1808596,1813839,1816958,1817022]
#9
⏱️ 2.1 мс
select * from "stores" where "stores"."id" in (633, 756)
#10
⏱️ 3.14 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["tiberias"]
#11
⏱️ 2.84 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#12
⏱️ 2.3 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]