#1
⏱️ 176.58 мс
select "id" from "stores" where "is_active" = ? and "city_slug" = ?
Bindings:
[true,"ashkelon"]
#2
⏱️ 1694.64 мс
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",737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,"produce"]
#3
⏱️ 1041.7 мс
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",737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405,"produce"]
#4
⏱️ 13.81 мс
select * from "canonical_products" where "canonical_products"."id" in (3, 11, 33, 61, 83, 103, 144, 206, 221, 238, 241, 263)
#5
⏱️ 21.06 мс
select "id", "canonical_product_id" from "master_products" where "canonical_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[238,3,61,263,241,144,33,103,206,83,11,221]
#6
⏱️ 614.52 мс
select * from "deals" where "master_product_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and "is_active" = ? and "store_id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[10068958,8897354,8775869,7471575,7439517,5280320,5130723,4988681,4493674,4492337,4451296,4424403,4395765,4158159,4056801,4022757,4015584,4014328,3995472,3991426,3986539,3977176,3885380,3804990,3804944,3779870,3709707,3709706,3675179,3242406,3042526,2998448,8775862,809367,420472,8775826,8775829,8775837,8775838,8775841,8775842,8775845,8775843,8775844,8775847,8775846,8775848,8775850,8775851,8775859,8775861,8775867,8775868,4533490,98565,192305,764101,2713394,946602,95379,7696015,337070,1945358,190883,8775839,8775858,8775856,8775860,8775863,8775864,2769595,150735,123105,8775857,4869230,4619338,1980126,2928563,368474,374223,8775828,1453237,154873,133480,8775830,2317173,127029,2629564,130085,3084195,2722589,109535,196438,8775832,8775833,8775836,8775865,8775825,3261507,2950238,2742300,101044,3015043,8775840,8775866,8775849,8775853,8775855,2642425,3045691,101043,2603553,166089,97463,1907886,2645047,1907930,8775852,8775854,8775827,8775831,8775834,8775835,322317,189745,2901961,3549846,190787,96304,149227,192306,179969,150734,94867,102244,130325,192304,94974,109336,2666686,2671007,102185,199939,101339,2669724,122806,122841,124804,2670951,95010,101042,2639215,true,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405]
#7
⏱️ 8.3 мс
select * from "stores" where "stores"."id" in (37, 122, 131, 169, 303, 352, 405, 737)
#8
⏱️ 499.49 мс
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 = 8775862 THEN 8775869 WHEN sp.master_product_id = 809367 THEN 3675179 WHEN sp.master_product_id = 420472 THEN 3675179 WHEN sp.master_product_id = 8775826 THEN 8775869 WHEN sp.master_product_id = 8775829 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 = 4533490 THEN 8775869 WHEN sp.master_product_id = 98565 THEN 3675179 WHEN sp.master_product_id = 192305 THEN 4424403 WHEN sp.master_product_id = 764101 THEN 3675179 WHEN sp.master_product_id = 2713394 THEN 7471575 WHEN sp.master_product_id = 946602 THEN 3709706 WHEN sp.master_product_id = 7471575 THEN 7471575 WHEN sp.master_product_id = 95379 THEN 3675179 WHEN sp.master_product_id = 7696015 THEN 8775869 WHEN sp.master_product_id = 337070 THEN 3675179 WHEN sp.master_product_id = 1945358 THEN 3675179 WHEN sp.master_product_id = 190883 THEN 5280320 WHEN sp.master_product_id = 8775839 THEN 8775869 WHEN sp.master_product_id = 8775858 THEN 8775869 WHEN sp.master_product_id = 8775856 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 = 2769595 THEN 3675179 WHEN sp.master_product_id = 150735 THEN 5280320 WHEN sp.master_product_id = 123105 THEN 3675179 WHEN sp.master_product_id = 8775857 THEN 8775869 WHEN sp.master_product_id = 4869230 THEN 8775869 WHEN sp.master_product_id = 3242406 THEN 3242406 WHEN sp.master_product_id = 4619338 THEN 8775869 WHEN sp.master_product_id = 1980126 THEN 3709707 WHEN sp.master_product_id = 2928563 THEN 4424403 WHEN sp.master_product_id = 368474 THEN 3675179 WHEN sp.master_product_id = 374223 THEN 3675179 WHEN sp.master_product_id = 8775828 THEN 8775869 WHEN sp.master_product_id = 1453237 THEN 4424403 WHEN sp.master_product_id = 154873 THEN 3675179 WHEN sp.master_product_id = 133480 THEN 5130723 WHEN sp.master_product_id = 8775830 THEN 8775869 WHEN sp.master_product_id = 2317173 THEN 8897354 WHEN sp.master_product_id = 5130723 THEN 5130723 WHEN sp.master_product_id = 127029 THEN 3675179 WHEN sp.master_product_id = 2629564 THEN 3675179 WHEN sp.master_product_id = 130085 THEN 3675179 WHEN sp.master_product_id = 3084195 THEN 7471575 WHEN sp.master_product_id = 3804944 THEN 3804944 WHEN sp.master_product_id = 2722589 THEN 3804944 WHEN sp.master_product_id = 3675179 THEN 3675179 WHEN sp.master_product_id = 3709707 THEN 3709707 WHEN sp.master_product_id = 109535 THEN 5280320 WHEN sp.master_product_id = 196438 THEN 4424403 WHEN sp.master_product_id = 4424403 THEN 4424403 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 = 3261507 THEN 3675179 WHEN sp.master_product_id = 2950238 THEN 3675179 WHEN sp.master_product_id = 2742300 THEN 3675179 WHEN sp.master_product_id = 101044 THEN 3675179 WHEN sp.master_product_id = 3015043 THEN 3675179 WHEN sp.master_product_id = 8775840 THEN 8775869 WHEN sp.master_product_id = 8775866 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 = 2642425 THEN 8775869 WHEN sp.master_product_id = 3045691 THEN 3242406 WHEN sp.master_product_id = 8897354 THEN 8897354 WHEN sp.master_product_id = 101043 THEN 3675179 WHEN sp.master_product_id = 2603553 THEN 4424403 WHEN sp.master_product_id = 166089 THEN 4424403 WHEN sp.master_product_id = 97463 THEN 3675179 WHEN sp.master_product_id = 1907886 THEN 3675179 WHEN sp.master_product_id = 2645047 THEN 8775869 WHEN sp.master_product_id = 1907930 THEN 5130723 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 = 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 = 322317 THEN 3675179 WHEN sp.master_product_id = 189745 THEN 8775869 WHEN sp.master_product_id = 2901961 THEN 3675179 WHEN sp.master_product_id = 3549846 THEN 3675179 WHEN sp.master_product_id = 190787 THEN 8775869 WHEN sp.master_product_id = 96304 THEN 5280320 WHEN sp.master_product_id = 149227 THEN 3709706 WHEN sp.master_product_id = 3709706 THEN 3709706 WHEN sp.master_product_id = 192306 THEN 4424403 WHEN sp.master_product_id = 179969 THEN 4424403 WHEN sp.master_product_id = 3977176 THEN 3977176 WHEN sp.master_product_id = 150734 THEN 5130723 WHEN sp.master_product_id = 94867 THEN 3675179 WHEN sp.master_product_id = 102244 THEN 3675179 WHEN sp.master_product_id = 130325 THEN 3977176 WHEN sp.master_product_id = 192304 THEN 4424403 WHEN sp.master_product_id = 94974 THEN 3675179 WHEN sp.master_product_id = 109336 THEN 4424403 WHEN sp.master_product_id = 2666686 THEN 3709706 WHEN sp.master_product_id = 2671007 THEN 8775869 WHEN sp.master_product_id = 102185 THEN 3675179 WHEN sp.master_product_id = 199939 THEN 8775869 WHEN sp.master_product_id = 101339 THEN 3675179 WHEN sp.master_product_id = 2669724 THEN 3977176 WHEN sp.master_product_id = 122806 THEN 3675179 WHEN sp.master_product_id = 122841 THEN 3675179 WHEN sp.master_product_id = 5280320 THEN 5280320 WHEN sp.master_product_id = 124804 THEN 3675179 WHEN sp.master_product_id = 2670951 THEN 3804944 WHEN sp.master_product_id = 95010 THEN 3675179 WHEN sp.master_product_id = 101042 THEN 3675179 WHEN sp.master_product_id = 2639215 THEN 3675179 ELSE sp.master_product_id END limit 500
Bindings:
[10068958,8897354,8775869,7471575,7439517,5280320,5130723,4988681,4493674,4492337,4451296,4424403,4395765,4158159,4056801,4022757,4015584,4014328,3995472,3991426,3986539,3977176,3885380,3804990,3804944,3779870,3709707,3709706,3675179,3242406,3042526,2998448,8775862,809367,420472,8775826,8775829,8775837,8775838,8775841,8775842,8775845,8775843,8775844,8775847,8775846,8775848,8775850,8775851,8775859,8775861,8775867,8775868,4533490,98565,192305,764101,2713394,946602,95379,7696015,337070,1945358,190883,8775839,8775858,8775856,8775860,8775863,8775864,2769595,150735,123105,8775857,4869230,4619338,1980126,2928563,368474,374223,8775828,1453237,154873,133480,8775830,2317173,127029,2629564,130085,3084195,2722589,109535,196438,8775832,8775833,8775836,8775865,8775825,3261507,2950238,2742300,101044,3015043,8775840,8775866,8775849,8775853,8775855,2642425,3045691,101043,2603553,166089,97463,1907886,2645047,1907930,8775852,8775854,8775827,8775831,8775834,8775835,322317,189745,2901961,3549846,190787,96304,149227,192306,179969,150734,94867,102244,130325,192304,94974,109336,2666686,2671007,102185,199939,101339,2669724,122806,122841,124804,2670951,95010,101042,2639215,0,737,765,1394,1125,1159,1175,1192,544,1317,168,467,489,1361,37,122,131,169,182,247,303,352,405]
#9
⏱️ 55.77 мс
select * from "store_prices" where "id" in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Bindings:
[452679,454041,70587981,6345481,6347827,6043549,6051176,547083,548563,5582205,5582486,5592052,5234910,5236685,5251237,1460193,1461829,70370360,11753984,11753995,11733642,11734959,11735290,11767721,11735300,11770521,30100314,2465533,11753997,2465462,31509459,56578614,12112152,2541859,2541849,2541793,2544347,33829135,31710621,3344087,3339368,24373703,3339375,27647340,3347482,3822879,3339540,3346702,77818792,3823378,3809247,3353391,3820515,3815719,3817055,3340558,3340559,3826563,3880270,4030856,4024922,3884871,4028663,9806980,509270,510810]
#10
⏱️ 8.06 мс
select * from "stores" where "stores"."id" in (37, 122, 131, 169, 303, 352, 405, 467, 489, 544, 737, 765)
#11
⏱️ 14.15 мс
select * from "locations" where "city_slug" = ? limit 1
Bindings:
["ashkelon"]
#12
⏱️ 8.91 мс
select * from "locations" where "is_popular" = ? order by "sort_order" asc
Bindings:
[true]
#13
⏱️ 13.83 мс
select * from "locations" where "is_active" = ? order by "is_popular" desc, "sort_order" asc
Bindings:
[true]