#1
⏱️ 139.27 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"jerusalem"]
#2
⏱️ 1765.74 мс
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",1110,83,114,143,727,728,745,746,759,775,315,320,106,170,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,85,166,279,429,436,437,461,485,486,535,1371,1385,1386,1409,6,700,87,88,109,149,171,208,259,268,278,281,286,274,306,332,true,1110,83,114,143,727,728,745,746,759,775,315,320,106,170,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,85,166,279,429,436,437,461,485,486,535,1371,1385,1386,1409,6,700,87,88,109,149,171,208,259,268,278,281,286,274,306,332,"produce"]
#3
⏱️ 686.97 мс
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",1110,83,114,143,727,728,745,746,759,775,315,320,106,170,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,85,166,279,429,436,437,461,485,486,535,1371,1385,1386,1409,6,700,87,88,109,149,171,208,259,268,278,281,286,274,306,332,true,1110,83,114,143,727,728,745,746,759,775,315,320,106,170,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,85,166,279,429,436,437,461,485,486,535,1371,1385,1386,1409,6,700,87,88,109,149,171,208,259,268,278,281,286,274,306,332,"produce"]
#4
⏱️ 8.4 мс
select * from "canonical_products" where "canonical_products"."id" in (16, 31, 37, 44, 71, 84, 90, 139, 159, 194)
#5
⏱️ 3.14 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[37,31,16,159,194,71,84,139,44,90]
#6
⏱️ 966.48 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,7561917,7529435,7489530,7477797,7472471,7466366,7461021,7455068,7454739,7446739,7431628,7428697,6908951,6744655,6708345,6571261,6557578,5130389,4983751,4573907,4039359,3995178,3919658,3915123,7471561,8775708,8775709,8775707,8775710,8775711,8775712,2609947,115658,111499,114703,115686,8775781,160965,1909820,2927777,134045,1454922,165505,1458061,1909941,1930007,205836,112818,127440,129463,96458,133472,2712622,195947,1941919,1456452,157276,191901,157163,4029456,true,1110,83,114,143,727,728,745,746,759,775,315,320,106,170,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,85,166,279,429,436,437,461,485,486,535,1371,1385,1386,1409,6,700,87,88,109,149,171,208,259,268,278,281,286,274,306,332]
#7
⏱️ 13.29 мс
select * from "stores" where "stores"."id" in (6, 69, 83, 85, 87, 88, 106, 109, 114, 143, 149, 170, 171, 274, 278, 279, 281, 286, 306, 315, 320, 332, 535, 700, 727, 728, 745, 746)
#8
⏱️ 63.14 мс
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 = 8775528 THEN 8775528 WHEN sp.master_product_id = 7471561 THEN 8775528 WHEN sp.master_product_id = 8775708 THEN 8775713 WHEN sp.master_product_id = 8775709 THEN 8775713 WHEN sp.master_product_id = 8775707 THEN 8775713 WHEN sp.master_product_id = 8775710 THEN 8775713 WHEN sp.master_product_id = 8775711 THEN 8775713 WHEN sp.master_product_id = 8775712 THEN 8775713 WHEN sp.master_product_id = 2609947 THEN 8775713 WHEN sp.master_product_id = 115658 THEN 8775713 WHEN sp.master_product_id = 8775713 THEN 8775713 WHEN sp.master_product_id = 111499 THEN 8775713 WHEN sp.master_product_id = 114703 THEN 8775713 WHEN sp.master_product_id = 115686 THEN 8775713 WHEN sp.master_product_id = 8775781 THEN 8775782 WHEN sp.master_product_id = 8775782 THEN 8775782 WHEN sp.master_product_id = 7428697 THEN 7428697 WHEN sp.master_product_id = 160965 THEN 7428697 WHEN sp.master_product_id = 1909820 THEN 7477797 WHEN sp.master_product_id = 2927777 THEN 7477797 WHEN sp.master_product_id = 7477797 THEN 7477797 WHEN sp.master_product_id = 134045 THEN 7477797 WHEN sp.master_product_id = 1454922 THEN 7461021 WHEN sp.master_product_id = 7461021 THEN 7461021 WHEN sp.master_product_id = 165505 THEN 7461021 WHEN sp.master_product_id = 1458061 THEN 4039359 WHEN sp.master_product_id = 1909941 THEN 4039359 WHEN sp.master_product_id = 1930007 THEN 4039359 WHEN sp.master_product_id = 205836 THEN 4039359 WHEN sp.master_product_id = 112818 THEN 4039359 WHEN sp.master_product_id = 4039359 THEN 4039359 WHEN sp.master_product_id = 127440 THEN 4039359 WHEN sp.master_product_id = 129463 THEN 4039359 WHEN sp.master_product_id = 7454739 THEN 7454739 WHEN sp.master_product_id = 96458 THEN 7454739 WHEN sp.master_product_id = 133472 THEN 7454739 WHEN sp.master_product_id = 2712622 THEN 7454739 WHEN sp.master_product_id = 7561917 THEN 7561917 WHEN sp.master_product_id = 195947 THEN 7561917 WHEN sp.master_product_id = 1941919 THEN 7561917 WHEN sp.master_product_id = 1456452 THEN 7561917 WHEN sp.master_product_id = 157276 THEN 7561917 WHEN sp.master_product_id = 191901 THEN 7561917 WHEN sp.master_product_id = 157163 THEN 7561917 WHEN sp.master_product_id = 4029456 THEN 7529435 WHEN sp.master_product_id = 7529435 THEN 7529435 ELSE sp.master_product_id END limit 500
Bindings:
[8775782,8775713,8775651,8775580,8775546,8775533,8775528,8775519,7561917,7529435,7489530,7477797,7472471,7466366,7461021,7455068,7454739,7446739,7431628,7428697,6908951,6744655,6708345,6571261,6557578,5130389,4983751,4573907,4039359,3995178,3919658,3915123,7471561,8775708,8775709,8775707,8775710,8775711,8775712,2609947,115658,111499,114703,115686,8775781,160965,1909820,2927777,134045,1454922,165505,1458061,1909941,1930007,205836,112818,127440,129463,96458,133472,2712622,195947,1941919,1456452,157276,191901,157163,4029456,0,1110,83,114,143,727,728,745,746,759,775,315,320,106,170,1126,1166,482,483,1186,1210,1220,1229,1263,1286,1301,1308,1313,1318,1319,1336,1344,66,69,77,78,85,166,279,429,436,437,461,485,486,535,1371,1385,1386,1409,6,700,87,88,109,149,171,208,259,268,278,281,286,274,306,332]
#9
⏱️ 99.34 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[1563158,4795904,4790348,4786877,4740041,4737206,4693062,4692645,4672099,4671705,64313891,5469409,4980658,4982689,4995357,556264,4967808,4958866,4953074,4925317,4910898,4907446,4916194,4891456,633030,5420787,5412975,5420658,5410175,5721948,5717035,5691080,5686241,5693541,5683614,5628431,5621174,5616028,5457181,656675,5450194,5445333,5532706,4957348,695752,719552,1999981,10503663,10518846,2011471,10500716,29375658,2101079,10712046,10691614,2107485,2104528,10687438,2115012,2114743,10720778,2120774,2111976,33274004,78253442,2394592,11511305,11540880,2394383,68187920,2394574,1847311,10360756,10370919,1855828,1849196,1845490,10367864,1858906,10378650,10375671,1869408,29251015,1869125,10371238,12090292,33814617,12095817,33804638,31694535,33812562,56571709,30261767,30257127,30256026,30257098,33807420,30256697,30257900,30257091,2536633,47640781,2537502,12108307,42134646,30271560,2539412,30266782,2537397,2537858,47649417,2537780,56574518,12103362,2538268,2537851,145659,147946,141630,9557944,9560129,9560336,9560451,9560750,9570916,9581312,144754,9613075,245331,3956241,4024826,3835884,9440271,9440266,9440278,9440290,9440356,9440408,9440593,4066665,9440882,3956242,4024827,3835885,9557924,9560109,9560316,9560431,9560730,9570896,9581292,4066666,9613055,1657608,66077228,10178734,10175184,9988137,1666633,1662133,9987925,1677593,6727497,6726846,1672978,1668887,476716]
#10
⏱️ 15.2 мс
select * from "stores" where "stores"."id" in (6, 83, 85, 87, 88, 109, 143, 149, 170, 171, 259, 274, 278, 279, 281, 286, 306, 315, 320, 332, 429, 436, 437, 461, 482, 483, 485, 486, 535, 700, 727, 728, 745, 746, 759)
#11
⏱️ 7.53 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["jerusalem"]
#12
⏱️ 5.98 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 10.48 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]