#1
⏱️ 213.98 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"dimona"]
#2
⏱️ 298.9 мс
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",127,true,127,"produce"]
#3
⏱️ 141.79 мс
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",127,true,127,"produce"]
#4
⏱️ 12.81 мс
select * from "canonical_products" where "canonical_products"."id" in (98, 230, 351, 376)
#5
⏱️ 6.94 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?)
Bindings:
[98,230,376,351]
#6
⏱️ 28.56 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?)
Bindings:
[365009,364409,128513,114699,113193,112191,109894,109893,109892,109891,109890,107138,104506,103522,103521,103520,103516,103514,103513,103512,103511,103510,103345,100730,100538,100390,100384,100366,100350,100348,100347,100286,97293,100284,100287,100283,true,127]
#7
⏱️ 3.08 мс
select * from "stores" where "stores"."id" in (127)
#8
⏱️ 20.68 мс
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 = 100366 THEN 100366 WHEN sp.master_product_id = 97293 THEN 100366 WHEN sp.master_product_id = 100284 THEN 100350 WHEN sp.master_product_id = 100350 THEN 100350 WHEN sp.master_product_id = 100287 THEN 100347 WHEN sp.master_product_id = 100347 THEN 100347 WHEN sp.master_product_id = 100348 THEN 100348 WHEN sp.master_product_id = 100283 THEN 100348 ELSE sp.master_product_id END limit 500
Bindings:
[365009,364409,128513,114699,113193,112191,109894,109893,109892,109891,109890,107138,104506,103522,103521,103520,103516,103514,103513,103512,103511,103510,103345,100730,100538,100390,100384,100366,100350,100348,100347,100286,97293,100284,100287,100283,0,127]
#9
⏱️ 21.78 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[6217280,6217281,6217339,6217340,6208855,6217373,6217375,6217528,6218733,6207090,6207290,6207291,6207292,6207293,6207294,6207296,6207300,6207301,6207302,6209736,6215914,6203608,6203609,6203620,6203617,6203618,6209980,6209981,6211387,6211178,6209977,6211386]
#10
⏱️ 8.18 мс
select * from "stores" where "stores"."id" in (127)
#11
⏱️ 11.41 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["dimona"]
#12
⏱️ 11.48 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 11.74 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]