#1
⏱️ 160.85 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"holon"]
#2
⏱️ 423.23 мс
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",1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411,true,1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411,"produce"]
#3
⏱️ 242.48 мс
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",1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411,true,1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411,"produce"]
#4
⏱️ 6.33 мс
select * from "canonical_products" where "canonical_products"."id" in (3, 30, 171, 182, 187, 241)
#5
⏱️ 6.88 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?)
Bindings:
[3,241,171,182,30,187]
#6
⏱️ 49.32 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775869,7443254,5130723,5127697,4988681,4344609,4222653,4214558,4158159,4110824,4043256,4023736,4022757,4009223,4003162,3985360,3973613,3855376,2797107,2715904,2682071,2681942,2680174,2671353,2671011,2670954,2670949,2670946,2668399,2666943,2666106,2662799,8775857,8775862,8775826,8775829,8775830,8775837,8775838,8775841,8775842,8775845,8775843,8775844,8775847,8775846,8775848,8775850,8775851,8775859,8775861,8775867,8775868,2645047,7696015,8775839,8775856,8775858,8775860,8775863,8775864,199939,4869230,4619338,8775832,8775833,8775836,8775865,8775825,8775828,4533490,189745,8775840,8775849,8775853,8775855,8775866,2642425,2671007,8775827,8775831,8775834,8775835,8775852,8775854,190787,1933366,2045916,157118,157278,155793,1960939,10941098,1907930,150734,133480,true,1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411]
#7
⏱️ 7.44 мс
select * from "stores" where "stores"."id" in (528)
#8
⏱️ 359.03 мс
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 = 8775857 THEN 8775869 WHEN sp.master_product_id = 8775862 THEN 8775869 WHEN sp.master_product_id = 8775826 THEN 8775869 WHEN sp.master_product_id = 8775829 THEN 8775869 WHEN sp.master_product_id = 8775830 THEN 8775869 WHEN sp.master_product_id = 8775837 THEN 8775869 WHEN sp.master_product_id = 8775838 THEN 8775869 WHEN sp.master_product_id = 8775841 THEN 8775869 WHEN sp.master_product_id = 8775842 THEN 8775869 WHEN sp.master_product_id = 8775845 THEN 8775869 WHEN sp.master_product_id = 8775843 THEN 8775869 WHEN sp.master_product_id = 8775844 THEN 8775869 WHEN sp.master_product_id = 8775847 THEN 8775869 WHEN sp.master_product_id = 8775846 THEN 8775869 WHEN sp.master_product_id = 8775848 THEN 8775869 WHEN sp.master_product_id = 8775850 THEN 8775869 WHEN sp.master_product_id = 8775851 THEN 8775869 WHEN sp.master_product_id = 8775859 THEN 8775869 WHEN sp.master_product_id = 8775861 THEN 8775869 WHEN sp.master_product_id = 8775867 THEN 8775869 WHEN sp.master_product_id = 8775868 THEN 8775869 WHEN sp.master_product_id = 2645047 THEN 8775869 WHEN sp.master_product_id = 7696015 THEN 8775869 WHEN sp.master_product_id = 8775839 THEN 8775869 WHEN sp.master_product_id = 8775856 THEN 8775869 WHEN sp.master_product_id = 8775858 THEN 8775869 WHEN sp.master_product_id = 8775860 THEN 8775869 WHEN sp.master_product_id = 8775863 THEN 8775869 WHEN sp.master_product_id = 8775864 THEN 8775869 WHEN sp.master_product_id = 199939 THEN 8775869 WHEN sp.master_product_id = 4869230 THEN 8775869 WHEN sp.master_product_id = 4619338 THEN 8775869 WHEN sp.master_product_id = 8775832 THEN 8775869 WHEN sp.master_product_id = 8775833 THEN 8775869 WHEN sp.master_product_id = 8775836 THEN 8775869 WHEN sp.master_product_id = 8775865 THEN 8775869 WHEN sp.master_product_id = 8775825 THEN 8775869 WHEN sp.master_product_id = 8775828 THEN 8775869 WHEN sp.master_product_id = 4533490 THEN 8775869 WHEN sp.master_product_id = 189745 THEN 8775869 WHEN sp.master_product_id = 8775840 THEN 8775869 WHEN sp.master_product_id = 8775849 THEN 8775869 WHEN sp.master_product_id = 8775853 THEN 8775869 WHEN sp.master_product_id = 8775855 THEN 8775869 WHEN sp.master_product_id = 8775866 THEN 8775869 WHEN sp.master_product_id = 2642425 THEN 8775869 WHEN sp.master_product_id = 2671007 THEN 8775869 WHEN sp.master_product_id = 8775827 THEN 8775869 WHEN sp.master_product_id = 8775831 THEN 8775869 WHEN sp.master_product_id = 8775834 THEN 8775869 WHEN sp.master_product_id = 8775835 THEN 8775869 WHEN sp.master_product_id = 8775852 THEN 8775869 WHEN sp.master_product_id = 8775854 THEN 8775869 WHEN sp.master_product_id = 8775869 THEN 8775869 WHEN sp.master_product_id = 190787 THEN 8775869 WHEN sp.master_product_id = 1933366 THEN 2670949 WHEN sp.master_product_id = 2670949 THEN 2670949 WHEN sp.master_product_id = 2045916 THEN 4110824 WHEN sp.master_product_id = 4110824 THEN 4110824 WHEN sp.master_product_id = 157118 THEN 4110824 WHEN sp.master_product_id = 157278 THEN 4110824 WHEN sp.master_product_id = 155793 THEN 4110824 WHEN sp.master_product_id = 2681942 THEN 2681942 WHEN sp.master_product_id = 1960939 THEN 2681942 WHEN sp.master_product_id = 2666943 THEN 2666943 WHEN sp.master_product_id = 10941098 THEN 2666943 WHEN sp.master_product_id = 5130723 THEN 5130723 WHEN sp.master_product_id = 1907930 THEN 5130723 WHEN sp.master_product_id = 150734 THEN 5130723 WHEN sp.master_product_id = 133480 THEN 5130723 ELSE sp.master_product_id END limit 500
Bindings:
[8775869,7443254,5130723,5127697,4988681,4344609,4222653,4214558,4158159,4110824,4043256,4023736,4022757,4009223,4003162,3985360,3973613,3855376,2797107,2715904,2682071,2681942,2680174,2671353,2671011,2670954,2670949,2670946,2668399,2666943,2666106,2662799,8775857,8775862,8775826,8775829,8775830,8775837,8775838,8775841,8775842,8775845,8775843,8775844,8775847,8775846,8775848,8775850,8775851,8775859,8775861,8775867,8775868,2645047,7696015,8775839,8775856,8775858,8775860,8775863,8775864,199939,4869230,4619338,8775832,8775833,8775836,8775865,8775825,8775828,4533490,189745,8775840,8775849,8775853,8775855,8775866,2642425,2671007,8775827,8775831,8775834,8775835,8775852,8775854,190787,1933366,2045916,157118,157278,155793,1960939,10941098,1907930,150734,133480,0,1114,752,1168,1216,1327,253,23,145,167,234,360,528,463,497,552,573,665,678,1411]
#9
⏱️ 24.07 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[2418269,2418497,2577771,2577721,2578803,4030867,67241,67248,4028674,3536279,3546062,3540022,3539640,3540363,3539990,3537409,3546242,3538233,3546336,3670863,3667135,3668019,3664810,1761519,1761272,1754584,1762825,1754594,1754597,1754604,1754734,1758913,1758118,1763908,6803441,1762741]
#10
⏱️ 7.32 мс
select * from "stores" where "stores"."id" in (463, 497, 528, 552, 573, 752)
#11
⏱️ 9.31 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["holon"]
#12
⏱️ 7.42 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 10.45 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]