Advertisement
Guest User

Untitled

a guest
May 17th, 2023
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 175.74 KB | None | 0 0
  1. Aggregate  (cost=878203.86..878203.87 rows=1 width=8) (actual time=2.298..2.321 rows=1 loops=1)
  2.   Output: count(*)
  3.   Buffers: shared hit=471
  4.   ->  GroupAggregate  (cost=1896.02..878200.20 rows=293 width=1069) (actual time=1.940..2.312 rows=182 loops=1)
  5.         Output: NULL::numeric, NULL::bigint, NULL::character varying(100), NULL::character varying(100), NULL::bigint, NULL::bigint, (COALESCE(warehouse_warranty.title)), NULL::character varying(50), (CASE WHEN (hashed SubPlan 2) THEN true ELSE false END), (CASE WHEN CASE WHEN (hashed SubPlan 4) THEN true ELSE false END THEN (SubPlan 5) ELSE 'no_voucher'::character varying END), (CASE WHEN CASE WHEN (hashed SubPlan 7) THEN true ELSE false END THEN (SubPlan 8) ELSE 'no_voucher'::character varying END), (CASE WHEN (CASE WHEN (hashed SubPlan 10) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 12) THEN true ELSE false END THEN (SubPlan 13) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 15) THEN true ELSE false END THEN (SubPlan 16) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 17) ELSE '0'::numeric END), (CASE WHEN (CASE WHEN (hashed SubPlan 19) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 21) THEN true ELSE false END THEN (SubPlan 22) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 24) THEN true ELSE false END THEN (SubPlan 25) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 26) ELSE 0 END), (CASE WHEN (CASE WHEN (hashed SubPlan 28) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 30) THEN true ELSE false END THEN (SubPlan 31) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 33) THEN true ELSE false END THEN (SubPlan 34) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN ((SubPlan 35) - CASE WHEN (CASE WHEN (hashed SubPlan 37) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 39) THEN true ELSE false END THEN (SubPlan 40) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 42) THEN true ELSE false END THEN (SubPlan 43) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 44) ELSE '0'::numeric END) WHEN (CASE WHEN (hashed SubPlan 46) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 48) THEN true ELSE false END THEN (SubPlan 49) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 51) THEN true ELSE false END THEN (SubPlan 52) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (((SubPlan 53) * ((100 - CASE WHEN (CASE WHEN (hashed SubPlan 55) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 57) THEN true ELSE false END THEN (SubPlan 58) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 60) THEN true ELSE false END THEN (SubPlan 61) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 62) ELSE 0 END))::numeric) / '100'::numeric) ELSE '0'::numeric END), warehouse_product.id
  6.         Group Key: warehouse_product.id, (COALESCE(warehouse_warranty.title)), (CASE WHEN (hashed SubPlan 2) THEN true ELSE false END), (CASE WHEN CASE WHEN (hashed SubPlan 4) THEN true ELSE false END THEN (SubPlan 5) ELSE 'no_voucher'::character varying END), (CASE WHEN CASE WHEN (hashed SubPlan 7) THEN true ELSE false END THEN (SubPlan 8) ELSE 'no_voucher'::character varying END), (CASE WHEN (CASE WHEN (hashed SubPlan 10) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 12) THEN true ELSE false END THEN (SubPlan 13) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 15) THEN true ELSE false END THEN (SubPlan 16) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 17) ELSE '0'::numeric END), (CASE WHEN (CASE WHEN (hashed SubPlan 19) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 21) THEN true ELSE false END THEN (SubPlan 22) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 24) THEN true ELSE false END THEN (SubPlan 25) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 26) ELSE 0 END), (CASE WHEN (CASE WHEN (hashed SubPlan 28) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 30) THEN true ELSE false END THEN (SubPlan 31) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 33) THEN true ELSE false END THEN (SubPlan 34) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN ((SubPlan 35) - CASE WHEN (CASE WHEN (hashed SubPlan 37) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 39) THEN true ELSE false END THEN (SubPlan 40) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 42) THEN true ELSE false END THEN (SubPlan 43) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 44) ELSE '0'::numeric END) WHEN (CASE WHEN (hashed SubPlan 46) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 48) THEN true ELSE false END THEN (SubPlan 49) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 51) THEN true ELSE false END THEN (SubPlan 52) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (((SubPlan 53) * ((100 - CASE WHEN (CASE WHEN (hashed SubPlan 55) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 57) THEN true ELSE false END THEN (SubPlan 58) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 60) THEN true ELSE false END THEN (SubPlan 61) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 62) ELSE 0 END))::numeric) / '100'::numeric) ELSE '0'::numeric END)
  7.         Buffers: shared hit=471
  8.         ->  Incremental Sort  (cost=1896.02..439174.95 rows=293 width=459) (actual time=1.937..2.181 rows=297 loops=1)
  9.               Output: (COALESCE(warehouse_warranty.title)), (CASE WHEN (hashed SubPlan 2) THEN true ELSE false END), (CASE WHEN CASE WHEN (hashed SubPlan 4) THEN true ELSE false END THEN (SubPlan 5) ELSE 'no_voucher'::character varying END), (CASE WHEN CASE WHEN (hashed SubPlan 7) THEN true ELSE false END THEN (SubPlan 8) ELSE 'no_voucher'::character varying END), (CASE WHEN (CASE WHEN (hashed SubPlan 10) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 12) THEN true ELSE false END THEN (SubPlan 13) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 15) THEN true ELSE false END THEN (SubPlan 16) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 17) ELSE '0'::numeric END), (CASE WHEN (CASE WHEN (hashed SubPlan 19) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 21) THEN true ELSE false END THEN (SubPlan 22) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 24) THEN true ELSE false END THEN (SubPlan 25) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 26) ELSE 0 END), (CASE WHEN (CASE WHEN (hashed SubPlan 28) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 30) THEN true ELSE false END THEN (SubPlan 31) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 33) THEN true ELSE false END THEN (SubPlan 34) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN ((SubPlan 35) - CASE WHEN (CASE WHEN (hashed SubPlan 37) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 39) THEN true ELSE false END THEN (SubPlan 40) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 42) THEN true ELSE false END THEN (SubPlan 43) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 44) ELSE '0'::numeric END) WHEN (CASE WHEN (hashed SubPlan 46) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 48) THEN true ELSE false END THEN (SubPlan 49) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 51) THEN true ELSE false END THEN (SubPlan 52) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (((SubPlan 53) * ((100 - CASE WHEN (CASE WHEN (hashed SubPlan 55) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 57) THEN true ELSE false END THEN (SubPlan 58) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 60) THEN true ELSE false END THEN (SubPlan 61) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 62) ELSE 0 END))::numeric) / '100'::numeric) ELSE '0'::numeric END), warehouse_product.id
  10.               Sort Key: warehouse_product.id, (COALESCE(warehouse_warranty.title)), (CASE WHEN (hashed SubPlan 2) THEN true ELSE false END), (CASE WHEN CASE WHEN (hashed SubPlan 4) THEN true ELSE false END THEN (SubPlan 5) ELSE 'no_voucher'::character varying END), (CASE WHEN CASE WHEN (hashed SubPlan 7) THEN true ELSE false END THEN (SubPlan 8) ELSE 'no_voucher'::character varying END), (CASE WHEN (CASE WHEN (hashed SubPlan 10) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 12) THEN true ELSE false END THEN (SubPlan 13) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 15) THEN true ELSE false END THEN (SubPlan 16) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 17) ELSE '0'::numeric END), (CASE WHEN (CASE WHEN (hashed SubPlan 19) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 21) THEN true ELSE false END THEN (SubPlan 22) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 24) THEN true ELSE false END THEN (SubPlan 25) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 26) ELSE 0 END), (CASE WHEN (CASE WHEN (hashed SubPlan 28) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 30) THEN true ELSE false END THEN (SubPlan 31) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 33) THEN true ELSE false END THEN (SubPlan 34) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN ((SubPlan 35) - CASE WHEN (CASE WHEN (hashed SubPlan 37) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 39) THEN true ELSE false END THEN (SubPlan 40) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 42) THEN true ELSE false END THEN (SubPlan 43) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 44) ELSE '0'::numeric END) WHEN (CASE WHEN (hashed SubPlan 46) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 48) THEN true ELSE false END THEN (SubPlan 49) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 51) THEN true ELSE false END THEN (SubPlan 52) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (((SubPlan 53) * ((100 - CASE WHEN (CASE WHEN (hashed SubPlan 55) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 57) THEN true ELSE false END THEN (SubPlan 58) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 60) THEN true ELSE false END THEN (SubPlan 61) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 62) ELSE 0 END))::numeric) / '100'::numeric) ELSE '0'::numeric END)
  11.               Presorted Key: warehouse_product.id
  12.               Full-sort Groups: 10  Sort Method: quicksort  Average Memory: 29kB  Peak Memory: 29kB
  13.               Buffers: shared hit=471
  14.               ->  Merge Join  (cost=139.91..439163.27 rows=293 width=459) (actual time=1.874..2.052 rows=297 loops=1)
  15.                     Output: COALESCE(warehouse_warranty.title), CASE WHEN (hashed SubPlan 2) THEN true ELSE false END, CASE WHEN CASE WHEN (hashed SubPlan 4) THEN true ELSE false END THEN (SubPlan 5) ELSE 'no_voucher'::character varying END, CASE WHEN CASE WHEN (hashed SubPlan 7) THEN true ELSE false END THEN (SubPlan 8) ELSE 'no_voucher'::character varying END, CASE WHEN (CASE WHEN (hashed SubPlan 10) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 12) THEN true ELSE false END THEN (SubPlan 13) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 15) THEN true ELSE false END THEN (SubPlan 16) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 17) ELSE '0'::numeric END, CASE WHEN (CASE WHEN (hashed SubPlan 19) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 21) THEN true ELSE false END THEN (SubPlan 22) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 24) THEN true ELSE false END THEN (SubPlan 25) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 26) ELSE 0 END, CASE WHEN (CASE WHEN (hashed SubPlan 28) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 30) THEN true ELSE false END THEN (SubPlan 31) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 33) THEN true ELSE false END THEN (SubPlan 34) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN ((SubPlan 35) - CASE WHEN (CASE WHEN (hashed SubPlan 37) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 39) THEN true ELSE false END THEN (SubPlan 40) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 42) THEN true ELSE false END THEN (SubPlan 43) ELSE 'no_voucher'::character varying END)::text = 'fixed_price_based'::text)) THEN (SubPlan 44) ELSE '0'::numeric END) WHEN (CASE WHEN (hashed SubPlan 46) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 48) THEN true ELSE false END THEN (SubPlan 49) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 51) THEN true ELSE false END THEN (SubPlan 52) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (((SubPlan 53) * ((100 - CASE WHEN (CASE WHEN (hashed SubPlan 55) THEN true ELSE false END AND ((CASE WHEN CASE WHEN (hashed SubPlan 57) THEN true ELSE false END THEN (SubPlan 58) ELSE 'no_voucher'::character varying END)::text = 'static_based'::text) AND ((CASE WHEN CASE WHEN (hashed SubPlan 60) THEN true ELSE false END THEN (SubPlan 61) ELSE 'no_voucher'::character varying END)::text = 'percentage_based'::text)) THEN (SubPlan 62) ELSE 0 END))::numeric) / '100'::numeric) ELSE '0'::numeric END, warehouse_product.id
  16.                     Merge Cond: (warehouse_product.id = t4.product_id)
  17.                     Buffers: shared hit=454
  18.                     ->  Sort  (cost=84.07..84.80 rows=293 width=16) (actual time=0.397..0.407 rows=297 loops=1)
  19.                           Output: warehouse_product.id, warehouse_pack.product_id
  20.                           Sort Key: warehouse_product.id
  21.                           Sort Method: quicksort  Memory: 38kB
  22.                           Buffers: shared hit=50
  23.                           ->  Hash Join  (cost=40.13..72.06 rows=293 width=16) (actual time=0.190..0.366 rows=297 loops=1)
  24.                                 Output: warehouse_product.id, warehouse_pack.product_id
  25.                                 Inner Unique: true
  26.                                 Hash Cond: (warehouse_pack.product_id = warehouse_product.id)
  27.                                 Buffers: shared hit=50
  28.                                 ->  Seq Scan on public.warehouse_pack  (cost=0.00..30.39 rows=586 width=16) (actual time=0.010..0.128 rows=586 loops=1)
  29.                                       Output: warehouse_pack.id, warehouse_pack.sku, warehouse_pack.created, warehouse_pack.modified, warehouse_pack.is_active, warehouse_pack.is_default, warehouse_pack.color_id, warehouse_pack.product_id, warehouse_pack.warranty_id
  30.                                       Filter: warehouse_pack.is_active
  31.                                       Rows Removed by Filter: 653
  32.                                       Buffers: shared hit=18
  33.                                 ->  Hash  (cost=37.00..37.00 rows=250 width=8) (actual time=0.171..0.171 rows=250 loops=1)
  34.                                       Output: warehouse_product.id
  35.                                       Buckets: 1024  Batches: 1  Memory Usage: 18kB
  36.                                       Buffers: shared hit=32
  37.                                       ->  Seq Scan on public.warehouse_product  (cost=0.00..37.00 rows=250 width=8) (actual time=0.006..0.142 rows=250 loops=1)
  38.                                             Output: warehouse_product.id
  39.                                             Filter: warehouse_product.is_active
  40.                                             Rows Removed by Filter: 250
  41.                                             Buffers: shared hit=32
  42.                     ->  Sort  (cost=55.85..57.10 rows=500 width=39) (actual time=0.224..0.240 rows=614 loops=1)
  43.                           Output: t4.product_id, warehouse_warranty.title
  44.                           Sort Key: t4.product_id
  45.                           Sort Method: quicksort  Memory: 64kB
  46.                           Buffers: shared hit=19
  47.                           ->  Hash Left Join  (cost=1.45..33.43 rows=500 width=39) (actual time=0.019..0.162 rows=500 loops=1)
  48.                                 Output: t4.product_id, warehouse_warranty.title
  49.                                 Inner Unique: true
  50.                                 Hash Cond: (t4.warranty_id = warehouse_warranty.id)
  51.                                 Buffers: shared hit=19
  52.                                 ->  Seq Scan on public.warehouse_pack t4  (cost=0.00..30.39 rows=500 width=16) (actual time=0.004..0.087 rows=500 loops=1)
  53.                                       Output: t4.id, t4.sku, t4.created, t4.modified, t4.is_active, t4.is_default, t4.color_id, t4.product_id, t4.warranty_id
  54.                                       Filter: t4.is_default
  55.                                       Rows Removed by Filter: 739
  56.                                       Buffers: shared hit=18
  57.                                 ->  Hash  (cost=1.20..1.20 rows=20 width=39) (actual time=0.010..0.010 rows=20 loops=1)
  58.                                       Output: warehouse_warranty.title, warehouse_warranty.id
  59.                                       Buckets: 1024  Batches: 1  Memory Usage: 10kB
  60.                                       Buffers: shared hit=1
  61.                                       ->  Seq Scan on public.warehouse_warranty  (cost=0.00..1.20 rows=20 width=39) (actual time=0.004..0.006 rows=20 loops=1)
  62.                                             Output: warehouse_warranty.title, warehouse_warranty.id
  63.                                             Buffers: shared hit=1
  64.                     SubPlan 2
  65.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (actual time=0.304..0.305 rows=0 loops=1)
  66.                             Output: u3.product_id
  67.                             Inner Unique: true
  68.                             Buffers: shared hit=55
  69.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (actual time=0.304..0.304 rows=0 loops=1)
  70.                                   Output: u2.pack_id
  71.                                   Buffers: shared hit=55
  72.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (actual time=0.304..0.304 rows=0 loops=1)
  73.                                         Output: u1.id
  74.                                         Inner Unique: true
  75.                                         Buffers: shared hit=55
  76.                                         ->  Seq Scan on public.voucher_voucher u0  (cost=0.00..77.50 rows=1 width=8) (actual time=0.304..0.304 rows=0 loops=1)
  77.                                               Output: u0.id, u0.title, u0.title_en, u0.title_fa, u0.slug, u0.description, u0.description_en, u0.description_fa, u0.created, u0.modified, u0.voucher_kind, u0.voucher_type, u0.status, u0.value_fixed_price_based_currency, u0.value_fixed_price_based, u0.value_percentage_based, u0.code, u0.excel_file, u0.min_basket_value_currency, u0.min_basket_value, u0.max_global_applications, u0.max_user_applications, u0.total_usage, u0.start_time, u0.end_time, u0.is_single_use_code
  78.                                               Filter: ((u0.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0.status)::text = 'open'::text) AND ((u0.voucher_kind)::text = 'static_based'::text) AND (u0.min_basket_value = '0'::numeric))
  79.                                               Rows Removed by Filter: 1000
  80.                                               Buffers: shared hit=55
  81.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1  (cost=0.28..8.29 rows=1 width=16) (never executed)
  82.                                               Output: u1.id, u1.created, u1.modified, u1.is_include_all_products, u1.voucher_id
  83.                                               Index Cond: (u1.voucher_id = u0.id)
  84.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2  (cost=0.28..0.39 rows=3 width=16) (never executed)
  85.                                         Output: u2.voucherrange_id, u2.pack_id
  86.                                         Index Cond: (u2.voucherrange_id = u1.id)
  87.                                         Heap Fetches: 0
  88.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3  (cost=0.28..0.33 rows=1 width=16) (never executed)
  89.                                   Output: u3.id, u3.sku, u3.created, u3.modified, u3.is_active, u3.is_default, u3.color_id, u3.product_id, u3.warranty_id
  90.                                   Index Cond: (u3.id = u2.pack_id)
  91.                     SubPlan 4
  92.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (actual time=0.163..0.163 rows=0 loops=1)
  93.                             Output: u3_1.product_id
  94.                             Inner Unique: true
  95.                             Buffers: shared hit=55
  96.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (actual time=0.163..0.163 rows=0 loops=1)
  97.                                   Output: u2_1.pack_id
  98.                                   Buffers: shared hit=55
  99.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (actual time=0.163..0.163 rows=0 loops=1)
  100.                                         Output: u1_1.id
  101.                                         Inner Unique: true
  102.                                         Buffers: shared hit=55
  103.                                         ->  Seq Scan on public.voucher_voucher u0_1  (cost=0.00..77.50 rows=1 width=8) (actual time=0.163..0.163 rows=0 loops=1)
  104.                                               Output: u0_1.id, u0_1.title, u0_1.title_en, u0_1.title_fa, u0_1.slug, u0_1.description, u0_1.description_en, u0_1.description_fa, u0_1.created, u0_1.modified, u0_1.voucher_kind, u0_1.voucher_type, u0_1.status, u0_1.value_fixed_price_based_currency, u0_1.value_fixed_price_based, u0_1.value_percentage_based, u0_1.code, u0_1.excel_file, u0_1.min_basket_value_currency, u0_1.min_basket_value, u0_1.max_global_applications, u0_1.max_user_applications, u0_1.total_usage, u0_1.start_time, u0_1.end_time, u0_1.is_single_use_code
  105.                                               Filter: ((u0_1.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_1.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_1.status)::text = 'open'::text) AND ((u0_1.voucher_kind)::text = 'static_based'::text) AND (u0_1.min_basket_value = '0'::numeric))
  106.                                               Rows Removed by Filter: 1000
  107.                                               Buffers: shared hit=55
  108.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_1  (cost=0.28..8.29 rows=1 width=16) (never executed)
  109.                                               Output: u1_1.id, u1_1.created, u1_1.modified, u1_1.is_include_all_products, u1_1.voucher_id
  110.                                               Index Cond: (u1_1.voucher_id = u0_1.id)
  111.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_1  (cost=0.28..0.39 rows=3 width=16) (never executed)
  112.                                         Output: u2_1.voucherrange_id, u2_1.pack_id
  113.                                         Index Cond: (u2_1.voucherrange_id = u1_1.id)
  114.                                         Heap Fetches: 0
  115.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_1  (cost=0.28..0.33 rows=1 width=16) (never executed)
  116.                                   Output: u3_1.id, u3_1.sku, u3_1.created, u3_1.modified, u3_1.is_active, u3_1.is_default, u3_1.color_id, u3_1.product_id, u3_1.warranty_id
  117.                                   Index Cond: (u3_1.id = u2_1.pack_id)
  118.                     SubPlan 5
  119.                       ->  Limit  (cost=5.69..39.39 rows=1 width=11) (never executed)
  120.                             Output: u0_2.voucher_kind
  121.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=11) (never executed)
  122.                                   Output: u0_2.voucher_kind
  123.                                   Inner Unique: true
  124.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=19) (never executed)
  125.                                         Output: u0_2.voucher_kind, u2_2.pack_id
  126.                                         Join Filter: (u1_2.id = u2_2.voucherrange_id)
  127.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=27) (never executed)
  128.                                               Output: u0_2.voucher_kind, u1_2.id, u5.voucherrange_id
  129.                                               Inner Unique: true
  130.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  131.                                                     Output: u1_2.voucher_id, u1_2.id, u5.voucherrange_id
  132.                                                     Inner Unique: true
  133.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  134.                                                           Output: u5.voucherrange_id
  135.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6  (cost=0.28..8.31 rows=2 width=8) (never executed)
  136.                                                                 Output: u6.id, u6.sku, u6.created, u6.modified, u6.is_active, u6.is_default, u6.color_id, u6.product_id, u6.warranty_id
  137.                                                                 Index Cond: (u6.product_id = warehouse_product.id)
  138.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5  (cost=4.30..12.86 rows=3 width=16) (never executed)
  139.                                                                 Output: u5.id, u5.voucherrange_id, u5.pack_id
  140.                                                                 Recheck Cond: (u5.pack_id = u6.id)
  141.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  142.                                                                       Index Cond: (u5.pack_id = u6.id)
  143.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_2  (cost=0.28..0.31 rows=1 width=16) (never executed)
  144.                                                           Output: u1_2.id, u1_2.created, u1_2.modified, u1_2.is_include_all_products, u1_2.voucher_id
  145.                                                           Index Cond: (u1_2.id = u5.voucherrange_id)
  146.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_2  (cost=0.28..0.54 rows=1 width=19) (never executed)
  147.                                                     Output: u0_2.id, u0_2.title, u0_2.title_en, u0_2.title_fa, u0_2.slug, u0_2.description, u0_2.description_en, u0_2.description_fa, u0_2.created, u0_2.modified, u0_2.voucher_kind, u0_2.voucher_type, u0_2.status, u0_2.value_fixed_price_based_currency, u0_2.value_fixed_price_based, u0_2.value_percentage_based, u0_2.code, u0_2.excel_file, u0_2.min_basket_value_currency, u0_2.min_basket_value, u0_2.max_global_applications, u0_2.max_user_applications, u0_2.total_usage, u0_2.start_time, u0_2.end_time, u0_2.is_single_use_code
  148.                                                     Index Cond: (u0_2.id = u1_2.voucher_id)
  149.                                                     Filter: ((u0_2.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_2.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_2.status)::text = 'open'::text) AND ((u0_2.voucher_kind)::text = 'static_based'::text) AND (u0_2.min_basket_value = '0'::numeric))
  150.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_2  (cost=0.28..0.35 rows=3 width=16) (never executed)
  151.                                               Output: u2_2.voucherrange_id, u2_2.pack_id
  152.                                               Index Cond: (u2_2.voucherrange_id = u5.voucherrange_id)
  153.                                               Heap Fetches: 0
  154.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_2  (cost=0.28..0.33 rows=1 width=8) (never executed)
  155.                                         Output: u3_2.id, u3_2.sku, u3_2.created, u3_2.modified, u3_2.is_active, u3_2.is_default, u3_2.color_id, u3_2.product_id, u3_2.warranty_id
  156.                                         Index Cond: (u3_2.id = u2_2.pack_id)
  157.                                         Filter: (u3_2.product_id = warehouse_product.id)
  158.                     SubPlan 7
  159.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (actual time=0.156..0.157 rows=0 loops=1)
  160.                             Output: u3_3.product_id
  161.                             Inner Unique: true
  162.                             Buffers: shared hit=55
  163.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (actual time=0.156..0.157 rows=0 loops=1)
  164.                                   Output: u2_3.pack_id
  165.                                   Buffers: shared hit=55
  166.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (actual time=0.156..0.156 rows=0 loops=1)
  167.                                         Output: u1_3.id
  168.                                         Inner Unique: true
  169.                                         Buffers: shared hit=55
  170.                                         ->  Seq Scan on public.voucher_voucher u0_3  (cost=0.00..77.50 rows=1 width=8) (actual time=0.156..0.156 rows=0 loops=1)
  171.                                               Output: u0_3.id, u0_3.title, u0_3.title_en, u0_3.title_fa, u0_3.slug, u0_3.description, u0_3.description_en, u0_3.description_fa, u0_3.created, u0_3.modified, u0_3.voucher_kind, u0_3.voucher_type, u0_3.status, u0_3.value_fixed_price_based_currency, u0_3.value_fixed_price_based, u0_3.value_percentage_based, u0_3.code, u0_3.excel_file, u0_3.min_basket_value_currency, u0_3.min_basket_value, u0_3.max_global_applications, u0_3.max_user_applications, u0_3.total_usage, u0_3.start_time, u0_3.end_time, u0_3.is_single_use_code
  172.                                               Filter: ((u0_3.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_3.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_3.status)::text = 'open'::text) AND ((u0_3.voucher_kind)::text = 'static_based'::text) AND (u0_3.min_basket_value = '0'::numeric))
  173.                                               Rows Removed by Filter: 1000
  174.                                               Buffers: shared hit=55
  175.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_3  (cost=0.28..8.29 rows=1 width=16) (never executed)
  176.                                               Output: u1_3.id, u1_3.created, u1_3.modified, u1_3.is_include_all_products, u1_3.voucher_id
  177.                                               Index Cond: (u1_3.voucher_id = u0_3.id)
  178.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_3  (cost=0.28..0.39 rows=3 width=16) (never executed)
  179.                                         Output: u2_3.voucherrange_id, u2_3.pack_id
  180.                                         Index Cond: (u2_3.voucherrange_id = u1_3.id)
  181.                                         Heap Fetches: 0
  182.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_3  (cost=0.28..0.33 rows=1 width=16) (never executed)
  183.                                   Output: u3_3.id, u3_3.sku, u3_3.created, u3_3.modified, u3_3.is_active, u3_3.is_default, u3_3.color_id, u3_3.product_id, u3_3.warranty_id
  184.                                   Index Cond: (u3_3.id = u2_3.pack_id)
  185.                     SubPlan 8
  186.                       ->  Limit  (cost=5.69..39.39 rows=1 width=17) (never executed)
  187.                             Output: u0_4.voucher_type
  188.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=17) (never executed)
  189.                                   Output: u0_4.voucher_type
  190.                                   Inner Unique: true
  191.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=25) (never executed)
  192.                                         Output: u0_4.voucher_type, u2_4.pack_id
  193.                                         Join Filter: (u1_4.id = u2_4.voucherrange_id)
  194.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=33) (never executed)
  195.                                               Output: u0_4.voucher_type, u1_4.id, u5_1.voucherrange_id
  196.                                               Inner Unique: true
  197.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  198.                                                     Output: u1_4.voucher_id, u1_4.id, u5_1.voucherrange_id
  199.                                                     Inner Unique: true
  200.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  201.                                                           Output: u5_1.voucherrange_id
  202.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_1  (cost=0.28..8.31 rows=2 width=8) (never executed)
  203.                                                                 Output: u6_1.id, u6_1.sku, u6_1.created, u6_1.modified, u6_1.is_active, u6_1.is_default, u6_1.color_id, u6_1.product_id, u6_1.warranty_id
  204.                                                                 Index Cond: (u6_1.product_id = warehouse_product.id)
  205.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_1  (cost=4.30..12.86 rows=3 width=16) (never executed)
  206.                                                                 Output: u5_1.id, u5_1.voucherrange_id, u5_1.pack_id
  207.                                                                 Recheck Cond: (u5_1.pack_id = u6_1.id)
  208.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  209.                                                                       Index Cond: (u5_1.pack_id = u6_1.id)
  210.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_4  (cost=0.28..0.31 rows=1 width=16) (never executed)
  211.                                                           Output: u1_4.id, u1_4.created, u1_4.modified, u1_4.is_include_all_products, u1_4.voucher_id
  212.                                                           Index Cond: (u1_4.id = u5_1.voucherrange_id)
  213.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_4  (cost=0.28..0.54 rows=1 width=25) (never executed)
  214.                                                     Output: u0_4.id, u0_4.title, u0_4.title_en, u0_4.title_fa, u0_4.slug, u0_4.description, u0_4.description_en, u0_4.description_fa, u0_4.created, u0_4.modified, u0_4.voucher_kind, u0_4.voucher_type, u0_4.status, u0_4.value_fixed_price_based_currency, u0_4.value_fixed_price_based, u0_4.value_percentage_based, u0_4.code, u0_4.excel_file, u0_4.min_basket_value_currency, u0_4.min_basket_value, u0_4.max_global_applications, u0_4.max_user_applications, u0_4.total_usage, u0_4.start_time, u0_4.end_time, u0_4.is_single_use_code
  215.                                                     Index Cond: (u0_4.id = u1_4.voucher_id)
  216.                                                     Filter: ((u0_4.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_4.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_4.status)::text = 'open'::text) AND ((u0_4.voucher_kind)::text = 'static_based'::text) AND (u0_4.min_basket_value = '0'::numeric))
  217.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_4  (cost=0.28..0.35 rows=3 width=16) (never executed)
  218.                                               Output: u2_4.voucherrange_id, u2_4.pack_id
  219.                                               Index Cond: (u2_4.voucherrange_id = u5_1.voucherrange_id)
  220.                                               Heap Fetches: 0
  221.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_4  (cost=0.28..0.33 rows=1 width=8) (never executed)
  222.                                         Output: u3_4.id, u3_4.sku, u3_4.created, u3_4.modified, u3_4.is_active, u3_4.is_default, u3_4.color_id, u3_4.product_id, u3_4.warranty_id
  223.                                         Index Cond: (u3_4.id = u2_4.pack_id)
  224.                                         Filter: (u3_4.product_id = warehouse_product.id)
  225.                     SubPlan 10
  226.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (actual time=0.151..0.151 rows=0 loops=1)
  227.                             Output: u3_5.product_id
  228.                             Inner Unique: true
  229.                             Buffers: shared hit=55
  230.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (actual time=0.151..0.151 rows=0 loops=1)
  231.                                   Output: u2_5.pack_id
  232.                                   Buffers: shared hit=55
  233.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (actual time=0.151..0.151 rows=0 loops=1)
  234.                                         Output: u1_5.id
  235.                                         Inner Unique: true
  236.                                         Buffers: shared hit=55
  237.                                         ->  Seq Scan on public.voucher_voucher u0_5  (cost=0.00..77.50 rows=1 width=8) (actual time=0.151..0.151 rows=0 loops=1)
  238.                                               Output: u0_5.id, u0_5.title, u0_5.title_en, u0_5.title_fa, u0_5.slug, u0_5.description, u0_5.description_en, u0_5.description_fa, u0_5.created, u0_5.modified, u0_5.voucher_kind, u0_5.voucher_type, u0_5.status, u0_5.value_fixed_price_based_currency, u0_5.value_fixed_price_based, u0_5.value_percentage_based, u0_5.code, u0_5.excel_file, u0_5.min_basket_value_currency, u0_5.min_basket_value, u0_5.max_global_applications, u0_5.max_user_applications, u0_5.total_usage, u0_5.start_time, u0_5.end_time, u0_5.is_single_use_code
  239.                                               Filter: ((u0_5.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_5.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_5.status)::text = 'open'::text) AND ((u0_5.voucher_kind)::text = 'static_based'::text) AND (u0_5.min_basket_value = '0'::numeric))
  240.                                               Rows Removed by Filter: 1000
  241.                                               Buffers: shared hit=55
  242.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_5  (cost=0.28..8.29 rows=1 width=16) (never executed)
  243.                                               Output: u1_5.id, u1_5.created, u1_5.modified, u1_5.is_include_all_products, u1_5.voucher_id
  244.                                               Index Cond: (u1_5.voucher_id = u0_5.id)
  245.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_5  (cost=0.28..0.39 rows=3 width=16) (never executed)
  246.                                         Output: u2_5.voucherrange_id, u2_5.pack_id
  247.                                         Index Cond: (u2_5.voucherrange_id = u1_5.id)
  248.                                         Heap Fetches: 0
  249.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_5  (cost=0.28..0.33 rows=1 width=16) (never executed)
  250.                                   Output: u3_5.id, u3_5.sku, u3_5.created, u3_5.modified, u3_5.is_active, u3_5.is_default, u3_5.color_id, u3_5.product_id, u3_5.warranty_id
  251.                                   Index Cond: (u3_5.id = u2_5.pack_id)
  252.                     SubPlan 12
  253.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  254.                             Output: u3_6.product_id
  255.                             Inner Unique: true
  256.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  257.                                   Output: u2_6.pack_id
  258.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  259.                                         Output: u1_6.id
  260.                                         Inner Unique: true
  261.                                         ->  Seq Scan on public.voucher_voucher u0_6  (cost=0.00..77.50 rows=1 width=8) (never executed)
  262.                                               Output: u0_6.id, u0_6.title, u0_6.title_en, u0_6.title_fa, u0_6.slug, u0_6.description, u0_6.description_en, u0_6.description_fa, u0_6.created, u0_6.modified, u0_6.voucher_kind, u0_6.voucher_type, u0_6.status, u0_6.value_fixed_price_based_currency, u0_6.value_fixed_price_based, u0_6.value_percentage_based, u0_6.code, u0_6.excel_file, u0_6.min_basket_value_currency, u0_6.min_basket_value, u0_6.max_global_applications, u0_6.max_user_applications, u0_6.total_usage, u0_6.start_time, u0_6.end_time, u0_6.is_single_use_code
  263.                                               Filter: ((u0_6.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_6.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_6.status)::text = 'open'::text) AND ((u0_6.voucher_kind)::text = 'static_based'::text) AND (u0_6.min_basket_value = '0'::numeric))
  264.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_6  (cost=0.28..8.29 rows=1 width=16) (never executed)
  265.                                               Output: u1_6.id, u1_6.created, u1_6.modified, u1_6.is_include_all_products, u1_6.voucher_id
  266.                                               Index Cond: (u1_6.voucher_id = u0_6.id)
  267.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_6  (cost=0.28..0.39 rows=3 width=16) (never executed)
  268.                                         Output: u2_6.voucherrange_id, u2_6.pack_id
  269.                                         Index Cond: (u2_6.voucherrange_id = u1_6.id)
  270.                                         Heap Fetches: 0
  271.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_6  (cost=0.28..0.33 rows=1 width=16) (never executed)
  272.                                   Output: u3_6.id, u3_6.sku, u3_6.created, u3_6.modified, u3_6.is_active, u3_6.is_default, u3_6.color_id, u3_6.product_id, u3_6.warranty_id
  273.                                   Index Cond: (u3_6.id = u2_6.pack_id)
  274.                     SubPlan 13
  275.                       ->  Limit  (cost=5.69..39.39 rows=1 width=11) (never executed)
  276.                             Output: u0_7.voucher_kind
  277.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=11) (never executed)
  278.                                   Output: u0_7.voucher_kind
  279.                                   Inner Unique: true
  280.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=19) (never executed)
  281.                                         Output: u0_7.voucher_kind, u2_7.pack_id
  282.                                         Join Filter: (u1_7.id = u2_7.voucherrange_id)
  283.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=27) (never executed)
  284.                                               Output: u0_7.voucher_kind, u1_7.id, u5_2.voucherrange_id
  285.                                               Inner Unique: true
  286.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  287.                                                     Output: u1_7.voucher_id, u1_7.id, u5_2.voucherrange_id
  288.                                                     Inner Unique: true
  289.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  290.                                                           Output: u5_2.voucherrange_id
  291.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_2  (cost=0.28..8.31 rows=2 width=8) (never executed)
  292.                                                                 Output: u6_2.id, u6_2.sku, u6_2.created, u6_2.modified, u6_2.is_active, u6_2.is_default, u6_2.color_id, u6_2.product_id, u6_2.warranty_id
  293.                                                                 Index Cond: (u6_2.product_id = warehouse_product.id)
  294.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_2  (cost=4.30..12.86 rows=3 width=16) (never executed)
  295.                                                                 Output: u5_2.id, u5_2.voucherrange_id, u5_2.pack_id
  296.                                                                 Recheck Cond: (u5_2.pack_id = u6_2.id)
  297.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  298.                                                                       Index Cond: (u5_2.pack_id = u6_2.id)
  299.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_7  (cost=0.28..0.31 rows=1 width=16) (never executed)
  300.                                                           Output: u1_7.id, u1_7.created, u1_7.modified, u1_7.is_include_all_products, u1_7.voucher_id
  301.                                                           Index Cond: (u1_7.id = u5_2.voucherrange_id)
  302.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_7  (cost=0.28..0.54 rows=1 width=19) (never executed)
  303.                                                     Output: u0_7.id, u0_7.title, u0_7.title_en, u0_7.title_fa, u0_7.slug, u0_7.description, u0_7.description_en, u0_7.description_fa, u0_7.created, u0_7.modified, u0_7.voucher_kind, u0_7.voucher_type, u0_7.status, u0_7.value_fixed_price_based_currency, u0_7.value_fixed_price_based, u0_7.value_percentage_based, u0_7.code, u0_7.excel_file, u0_7.min_basket_value_currency, u0_7.min_basket_value, u0_7.max_global_applications, u0_7.max_user_applications, u0_7.total_usage, u0_7.start_time, u0_7.end_time, u0_7.is_single_use_code
  304.                                                     Index Cond: (u0_7.id = u1_7.voucher_id)
  305.                                                     Filter: ((u0_7.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_7.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_7.status)::text = 'open'::text) AND ((u0_7.voucher_kind)::text = 'static_based'::text) AND (u0_7.min_basket_value = '0'::numeric))
  306.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_7  (cost=0.28..0.35 rows=3 width=16) (never executed)
  307.                                               Output: u2_7.voucherrange_id, u2_7.pack_id
  308.                                               Index Cond: (u2_7.voucherrange_id = u5_2.voucherrange_id)
  309.                                               Heap Fetches: 0
  310.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_7  (cost=0.28..0.33 rows=1 width=8) (never executed)
  311.                                         Output: u3_7.id, u3_7.sku, u3_7.created, u3_7.modified, u3_7.is_active, u3_7.is_default, u3_7.color_id, u3_7.product_id, u3_7.warranty_id
  312.                                         Index Cond: (u3_7.id = u2_7.pack_id)
  313.                                         Filter: (u3_7.product_id = warehouse_product.id)
  314.                     SubPlan 15
  315.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  316.                             Output: u3_8.product_id
  317.                             Inner Unique: true
  318.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  319.                                   Output: u2_8.pack_id
  320.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  321.                                         Output: u1_8.id
  322.                                         Inner Unique: true
  323.                                         ->  Seq Scan on public.voucher_voucher u0_8  (cost=0.00..77.50 rows=1 width=8) (never executed)
  324.                                               Output: u0_8.id, u0_8.title, u0_8.title_en, u0_8.title_fa, u0_8.slug, u0_8.description, u0_8.description_en, u0_8.description_fa, u0_8.created, u0_8.modified, u0_8.voucher_kind, u0_8.voucher_type, u0_8.status, u0_8.value_fixed_price_based_currency, u0_8.value_fixed_price_based, u0_8.value_percentage_based, u0_8.code, u0_8.excel_file, u0_8.min_basket_value_currency, u0_8.min_basket_value, u0_8.max_global_applications, u0_8.max_user_applications, u0_8.total_usage, u0_8.start_time, u0_8.end_time, u0_8.is_single_use_code
  325.                                               Filter: ((u0_8.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_8.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_8.status)::text = 'open'::text) AND ((u0_8.voucher_kind)::text = 'static_based'::text) AND (u0_8.min_basket_value = '0'::numeric))
  326.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_8  (cost=0.28..8.29 rows=1 width=16) (never executed)
  327.                                               Output: u1_8.id, u1_8.created, u1_8.modified, u1_8.is_include_all_products, u1_8.voucher_id
  328.                                               Index Cond: (u1_8.voucher_id = u0_8.id)
  329.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_8  (cost=0.28..0.39 rows=3 width=16) (never executed)
  330.                                         Output: u2_8.voucherrange_id, u2_8.pack_id
  331.                                         Index Cond: (u2_8.voucherrange_id = u1_8.id)
  332.                                         Heap Fetches: 0
  333.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_8  (cost=0.28..0.33 rows=1 width=16) (never executed)
  334.                                   Output: u3_8.id, u3_8.sku, u3_8.created, u3_8.modified, u3_8.is_active, u3_8.is_default, u3_8.color_id, u3_8.product_id, u3_8.warranty_id
  335.                                   Index Cond: (u3_8.id = u2_8.pack_id)
  336.                     SubPlan 16
  337.                       ->  Limit  (cost=5.69..39.39 rows=1 width=17) (never executed)
  338.                             Output: u0_9.voucher_type
  339.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=17) (never executed)
  340.                                   Output: u0_9.voucher_type
  341.                                   Inner Unique: true
  342.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=25) (never executed)
  343.                                         Output: u0_9.voucher_type, u2_9.pack_id
  344.                                         Join Filter: (u1_9.id = u2_9.voucherrange_id)
  345.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=33) (never executed)
  346.                                               Output: u0_9.voucher_type, u1_9.id, u5_3.voucherrange_id
  347.                                               Inner Unique: true
  348.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  349.                                                     Output: u1_9.voucher_id, u1_9.id, u5_3.voucherrange_id
  350.                                                     Inner Unique: true
  351.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  352.                                                           Output: u5_3.voucherrange_id
  353.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_3  (cost=0.28..8.31 rows=2 width=8) (never executed)
  354.                                                                 Output: u6_3.id, u6_3.sku, u6_3.created, u6_3.modified, u6_3.is_active, u6_3.is_default, u6_3.color_id, u6_3.product_id, u6_3.warranty_id
  355.                                                                 Index Cond: (u6_3.product_id = warehouse_product.id)
  356.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_3  (cost=4.30..12.86 rows=3 width=16) (never executed)
  357.                                                                 Output: u5_3.id, u5_3.voucherrange_id, u5_3.pack_id
  358.                                                                 Recheck Cond: (u5_3.pack_id = u6_3.id)
  359.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  360.                                                                       Index Cond: (u5_3.pack_id = u6_3.id)
  361.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_9  (cost=0.28..0.31 rows=1 width=16) (never executed)
  362.                                                           Output: u1_9.id, u1_9.created, u1_9.modified, u1_9.is_include_all_products, u1_9.voucher_id
  363.                                                           Index Cond: (u1_9.id = u5_3.voucherrange_id)
  364.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_9  (cost=0.28..0.54 rows=1 width=25) (never executed)
  365.                                                     Output: u0_9.id, u0_9.title, u0_9.title_en, u0_9.title_fa, u0_9.slug, u0_9.description, u0_9.description_en, u0_9.description_fa, u0_9.created, u0_9.modified, u0_9.voucher_kind, u0_9.voucher_type, u0_9.status, u0_9.value_fixed_price_based_currency, u0_9.value_fixed_price_based, u0_9.value_percentage_based, u0_9.code, u0_9.excel_file, u0_9.min_basket_value_currency, u0_9.min_basket_value, u0_9.max_global_applications, u0_9.max_user_applications, u0_9.total_usage, u0_9.start_time, u0_9.end_time, u0_9.is_single_use_code
  366.                                                     Index Cond: (u0_9.id = u1_9.voucher_id)
  367.                                                     Filter: ((u0_9.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_9.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_9.status)::text = 'open'::text) AND ((u0_9.voucher_kind)::text = 'static_based'::text) AND (u0_9.min_basket_value = '0'::numeric))
  368.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_9  (cost=0.28..0.35 rows=3 width=16) (never executed)
  369.                                               Output: u2_9.voucherrange_id, u2_9.pack_id
  370.                                               Index Cond: (u2_9.voucherrange_id = u5_3.voucherrange_id)
  371.                                               Heap Fetches: 0
  372.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_9  (cost=0.28..0.33 rows=1 width=8) (never executed)
  373.                                         Output: u3_9.id, u3_9.sku, u3_9.created, u3_9.modified, u3_9.is_active, u3_9.is_default, u3_9.color_id, u3_9.product_id, u3_9.warranty_id
  374.                                         Index Cond: (u3_9.id = u2_9.pack_id)
  375.                                         Filter: (u3_9.product_id = warehouse_product.id)
  376.                     SubPlan 17
  377.                       ->  Limit  (cost=5.13..11.77 rows=1 width=6) (never executed)
  378.                             Output: u0_10.value_fixed_price_based
  379.                             ->  Nested Loop  (cost=5.13..38.30 rows=5 width=6) (never executed)
  380.                                   Output: u0_10.value_fixed_price_based
  381.                                   Inner Unique: true
  382.                                   ->  Nested Loop  (cost=4.86..35.64 rows=5 width=8) (never executed)
  383.                                         Output: u1_10.voucher_id
  384.                                         Inner Unique: true
  385.                                         ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  386.                                               Output: u2_10.voucherrange_id
  387.                                               ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u3_10  (cost=0.28..8.31 rows=2 width=8) (never executed)
  388.                                                     Output: u3_10.id, u3_10.sku, u3_10.created, u3_10.modified, u3_10.is_active, u3_10.is_default, u3_10.color_id, u3_10.product_id, u3_10.warranty_id
  389.                                                     Index Cond: (u3_10.product_id = warehouse_product.id)
  390.                                               ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u2_10  (cost=4.30..12.86 rows=3 width=16) (never executed)
  391.                                                     Output: u2_10.id, u2_10.voucherrange_id, u2_10.pack_id
  392.                                                     Recheck Cond: (u2_10.pack_id = u3_10.id)
  393.                                                     ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  394.                                                           Index Cond: (u2_10.pack_id = u3_10.id)
  395.                                         ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_10  (cost=0.28..0.31 rows=1 width=16) (never executed)
  396.                                               Output: u1_10.id, u1_10.created, u1_10.modified, u1_10.is_include_all_products, u1_10.voucher_id
  397.                                               Index Cond: (u1_10.id = u2_10.voucherrange_id)
  398.                                   ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_10  (cost=0.28..0.53 rows=1 width=14) (never executed)
  399.                                         Output: u0_10.id, u0_10.title, u0_10.title_en, u0_10.title_fa, u0_10.slug, u0_10.description, u0_10.description_en, u0_10.description_fa, u0_10.created, u0_10.modified, u0_10.voucher_kind, u0_10.voucher_type, u0_10.status, u0_10.value_fixed_price_based_currency, u0_10.value_fixed_price_based, u0_10.value_percentage_based, u0_10.code, u0_10.excel_file, u0_10.min_basket_value_currency, u0_10.min_basket_value, u0_10.max_global_applications, u0_10.max_user_applications, u0_10.total_usage, u0_10.start_time, u0_10.end_time, u0_10.is_single_use_code
  400.                                         Index Cond: (u0_10.id = u1_10.voucher_id)
  401.                     SubPlan 19
  402.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (actual time=0.155..0.155 rows=0 loops=1)
  403.                             Output: u3_11.product_id
  404.                             Inner Unique: true
  405.                             Buffers: shared hit=55
  406.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (actual time=0.155..0.155 rows=0 loops=1)
  407.                                   Output: u2_11.pack_id
  408.                                   Buffers: shared hit=55
  409.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (actual time=0.155..0.155 rows=0 loops=1)
  410.                                         Output: u1_11.id
  411.                                         Inner Unique: true
  412.                                         Buffers: shared hit=55
  413.                                         ->  Seq Scan on public.voucher_voucher u0_11  (cost=0.00..77.50 rows=1 width=8) (actual time=0.155..0.155 rows=0 loops=1)
  414.                                               Output: u0_11.id, u0_11.title, u0_11.title_en, u0_11.title_fa, u0_11.slug, u0_11.description, u0_11.description_en, u0_11.description_fa, u0_11.created, u0_11.modified, u0_11.voucher_kind, u0_11.voucher_type, u0_11.status, u0_11.value_fixed_price_based_currency, u0_11.value_fixed_price_based, u0_11.value_percentage_based, u0_11.code, u0_11.excel_file, u0_11.min_basket_value_currency, u0_11.min_basket_value, u0_11.max_global_applications, u0_11.max_user_applications, u0_11.total_usage, u0_11.start_time, u0_11.end_time, u0_11.is_single_use_code
  415.                                               Filter: ((u0_11.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_11.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_11.status)::text = 'open'::text) AND ((u0_11.voucher_kind)::text = 'static_based'::text) AND (u0_11.min_basket_value = '0'::numeric))
  416.                                               Rows Removed by Filter: 1000
  417.                                               Buffers: shared hit=55
  418.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_11  (cost=0.28..8.29 rows=1 width=16) (never executed)
  419.                                               Output: u1_11.id, u1_11.created, u1_11.modified, u1_11.is_include_all_products, u1_11.voucher_id
  420.                                               Index Cond: (u1_11.voucher_id = u0_11.id)
  421.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_11  (cost=0.28..0.39 rows=3 width=16) (never executed)
  422.                                         Output: u2_11.voucherrange_id, u2_11.pack_id
  423.                                         Index Cond: (u2_11.voucherrange_id = u1_11.id)
  424.                                         Heap Fetches: 0
  425.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_11  (cost=0.28..0.33 rows=1 width=16) (never executed)
  426.                                   Output: u3_11.id, u3_11.sku, u3_11.created, u3_11.modified, u3_11.is_active, u3_11.is_default, u3_11.color_id, u3_11.product_id, u3_11.warranty_id
  427.                                   Index Cond: (u3_11.id = u2_11.pack_id)
  428.                     SubPlan 21
  429.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  430.                             Output: u3_12.product_id
  431.                             Inner Unique: true
  432.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  433.                                   Output: u2_12.pack_id
  434.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  435.                                         Output: u1_12.id
  436.                                         Inner Unique: true
  437.                                         ->  Seq Scan on public.voucher_voucher u0_12  (cost=0.00..77.50 rows=1 width=8) (never executed)
  438.                                               Output: u0_12.id, u0_12.title, u0_12.title_en, u0_12.title_fa, u0_12.slug, u0_12.description, u0_12.description_en, u0_12.description_fa, u0_12.created, u0_12.modified, u0_12.voucher_kind, u0_12.voucher_type, u0_12.status, u0_12.value_fixed_price_based_currency, u0_12.value_fixed_price_based, u0_12.value_percentage_based, u0_12.code, u0_12.excel_file, u0_12.min_basket_value_currency, u0_12.min_basket_value, u0_12.max_global_applications, u0_12.max_user_applications, u0_12.total_usage, u0_12.start_time, u0_12.end_time, u0_12.is_single_use_code
  439.                                               Filter: ((u0_12.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_12.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_12.status)::text = 'open'::text) AND ((u0_12.voucher_kind)::text = 'static_based'::text) AND (u0_12.min_basket_value = '0'::numeric))
  440.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_12  (cost=0.28..8.29 rows=1 width=16) (never executed)
  441.                                               Output: u1_12.id, u1_12.created, u1_12.modified, u1_12.is_include_all_products, u1_12.voucher_id
  442.                                               Index Cond: (u1_12.voucher_id = u0_12.id)
  443.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_12  (cost=0.28..0.39 rows=3 width=16) (never executed)
  444.                                         Output: u2_12.voucherrange_id, u2_12.pack_id
  445.                                         Index Cond: (u2_12.voucherrange_id = u1_12.id)
  446.                                         Heap Fetches: 0
  447.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_12  (cost=0.28..0.33 rows=1 width=16) (never executed)
  448.                                   Output: u3_12.id, u3_12.sku, u3_12.created, u3_12.modified, u3_12.is_active, u3_12.is_default, u3_12.color_id, u3_12.product_id, u3_12.warranty_id
  449.                                   Index Cond: (u3_12.id = u2_12.pack_id)
  450.                     SubPlan 22
  451.                       ->  Limit  (cost=5.69..39.39 rows=1 width=11) (never executed)
  452.                             Output: u0_13.voucher_kind
  453.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=11) (never executed)
  454.                                   Output: u0_13.voucher_kind
  455.                                   Inner Unique: true
  456.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=19) (never executed)
  457.                                         Output: u0_13.voucher_kind, u2_13.pack_id
  458.                                         Join Filter: (u1_13.id = u2_13.voucherrange_id)
  459.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=27) (never executed)
  460.                                               Output: u0_13.voucher_kind, u1_13.id, u5_4.voucherrange_id
  461.                                               Inner Unique: true
  462.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  463.                                                     Output: u1_13.voucher_id, u1_13.id, u5_4.voucherrange_id
  464.                                                     Inner Unique: true
  465.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  466.                                                           Output: u5_4.voucherrange_id
  467.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_4  (cost=0.28..8.31 rows=2 width=8) (never executed)
  468.                                                                 Output: u6_4.id, u6_4.sku, u6_4.created, u6_4.modified, u6_4.is_active, u6_4.is_default, u6_4.color_id, u6_4.product_id, u6_4.warranty_id
  469.                                                                 Index Cond: (u6_4.product_id = warehouse_product.id)
  470.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_4  (cost=4.30..12.86 rows=3 width=16) (never executed)
  471.                                                                 Output: u5_4.id, u5_4.voucherrange_id, u5_4.pack_id
  472.                                                                 Recheck Cond: (u5_4.pack_id = u6_4.id)
  473.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  474.                                                                       Index Cond: (u5_4.pack_id = u6_4.id)
  475.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_13  (cost=0.28..0.31 rows=1 width=16) (never executed)
  476.                                                           Output: u1_13.id, u1_13.created, u1_13.modified, u1_13.is_include_all_products, u1_13.voucher_id
  477.                                                           Index Cond: (u1_13.id = u5_4.voucherrange_id)
  478.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_13  (cost=0.28..0.54 rows=1 width=19) (never executed)
  479.                                                     Output: u0_13.id, u0_13.title, u0_13.title_en, u0_13.title_fa, u0_13.slug, u0_13.description, u0_13.description_en, u0_13.description_fa, u0_13.created, u0_13.modified, u0_13.voucher_kind, u0_13.voucher_type, u0_13.status, u0_13.value_fixed_price_based_currency, u0_13.value_fixed_price_based, u0_13.value_percentage_based, u0_13.code, u0_13.excel_file, u0_13.min_basket_value_currency, u0_13.min_basket_value, u0_13.max_global_applications, u0_13.max_user_applications, u0_13.total_usage, u0_13.start_time, u0_13.end_time, u0_13.is_single_use_code
  480.                                                     Index Cond: (u0_13.id = u1_13.voucher_id)
  481.                                                     Filter: ((u0_13.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_13.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_13.status)::text = 'open'::text) AND ((u0_13.voucher_kind)::text = 'static_based'::text) AND (u0_13.min_basket_value = '0'::numeric))
  482.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_13  (cost=0.28..0.35 rows=3 width=16) (never executed)
  483.                                               Output: u2_13.voucherrange_id, u2_13.pack_id
  484.                                               Index Cond: (u2_13.voucherrange_id = u5_4.voucherrange_id)
  485.                                               Heap Fetches: 0
  486.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_13  (cost=0.28..0.33 rows=1 width=8) (never executed)
  487.                                         Output: u3_13.id, u3_13.sku, u3_13.created, u3_13.modified, u3_13.is_active, u3_13.is_default, u3_13.color_id, u3_13.product_id, u3_13.warranty_id
  488.                                         Index Cond: (u3_13.id = u2_13.pack_id)
  489.                                         Filter: (u3_13.product_id = warehouse_product.id)
  490.                     SubPlan 24
  491.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  492.                             Output: u3_14.product_id
  493.                             Inner Unique: true
  494.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  495.                                   Output: u2_14.pack_id
  496.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  497.                                         Output: u1_14.id
  498.                                         Inner Unique: true
  499.                                         ->  Seq Scan on public.voucher_voucher u0_14  (cost=0.00..77.50 rows=1 width=8) (never executed)
  500.                                               Output: u0_14.id, u0_14.title, u0_14.title_en, u0_14.title_fa, u0_14.slug, u0_14.description, u0_14.description_en, u0_14.description_fa, u0_14.created, u0_14.modified, u0_14.voucher_kind, u0_14.voucher_type, u0_14.status, u0_14.value_fixed_price_based_currency, u0_14.value_fixed_price_based, u0_14.value_percentage_based, u0_14.code, u0_14.excel_file, u0_14.min_basket_value_currency, u0_14.min_basket_value, u0_14.max_global_applications, u0_14.max_user_applications, u0_14.total_usage, u0_14.start_time, u0_14.end_time, u0_14.is_single_use_code
  501.                                               Filter: ((u0_14.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_14.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_14.status)::text = 'open'::text) AND ((u0_14.voucher_kind)::text = 'static_based'::text) AND (u0_14.min_basket_value = '0'::numeric))
  502.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_14  (cost=0.28..8.29 rows=1 width=16) (never executed)
  503.                                               Output: u1_14.id, u1_14.created, u1_14.modified, u1_14.is_include_all_products, u1_14.voucher_id
  504.                                               Index Cond: (u1_14.voucher_id = u0_14.id)
  505.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_14  (cost=0.28..0.39 rows=3 width=16) (never executed)
  506.                                         Output: u2_14.voucherrange_id, u2_14.pack_id
  507.                                         Index Cond: (u2_14.voucherrange_id = u1_14.id)
  508.                                         Heap Fetches: 0
  509.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_14  (cost=0.28..0.33 rows=1 width=16) (never executed)
  510.                                   Output: u3_14.id, u3_14.sku, u3_14.created, u3_14.modified, u3_14.is_active, u3_14.is_default, u3_14.color_id, u3_14.product_id, u3_14.warranty_id
  511.                                   Index Cond: (u3_14.id = u2_14.pack_id)
  512.                     SubPlan 25
  513.                       ->  Limit  (cost=5.69..39.39 rows=1 width=17) (never executed)
  514.                             Output: u0_15.voucher_type
  515.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=17) (never executed)
  516.                                   Output: u0_15.voucher_type
  517.                                   Inner Unique: true
  518.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=25) (never executed)
  519.                                         Output: u0_15.voucher_type, u2_15.pack_id
  520.                                         Join Filter: (u1_15.id = u2_15.voucherrange_id)
  521.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=33) (never executed)
  522.                                               Output: u0_15.voucher_type, u1_15.id, u5_5.voucherrange_id
  523.                                               Inner Unique: true
  524.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  525.                                                     Output: u1_15.voucher_id, u1_15.id, u5_5.voucherrange_id
  526.                                                     Inner Unique: true
  527.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  528.                                                           Output: u5_5.voucherrange_id
  529.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_5  (cost=0.28..8.31 rows=2 width=8) (never executed)
  530.                                                                 Output: u6_5.id, u6_5.sku, u6_5.created, u6_5.modified, u6_5.is_active, u6_5.is_default, u6_5.color_id, u6_5.product_id, u6_5.warranty_id
  531.                                                                 Index Cond: (u6_5.product_id = warehouse_product.id)
  532.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_5  (cost=4.30..12.86 rows=3 width=16) (never executed)
  533.                                                                 Output: u5_5.id, u5_5.voucherrange_id, u5_5.pack_id
  534.                                                                 Recheck Cond: (u5_5.pack_id = u6_5.id)
  535.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  536.                                                                       Index Cond: (u5_5.pack_id = u6_5.id)
  537.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_15  (cost=0.28..0.31 rows=1 width=16) (never executed)
  538.                                                           Output: u1_15.id, u1_15.created, u1_15.modified, u1_15.is_include_all_products, u1_15.voucher_id
  539.                                                           Index Cond: (u1_15.id = u5_5.voucherrange_id)
  540.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_15  (cost=0.28..0.54 rows=1 width=25) (never executed)
  541.                                                     Output: u0_15.id, u0_15.title, u0_15.title_en, u0_15.title_fa, u0_15.slug, u0_15.description, u0_15.description_en, u0_15.description_fa, u0_15.created, u0_15.modified, u0_15.voucher_kind, u0_15.voucher_type, u0_15.status, u0_15.value_fixed_price_based_currency, u0_15.value_fixed_price_based, u0_15.value_percentage_based, u0_15.code, u0_15.excel_file, u0_15.min_basket_value_currency, u0_15.min_basket_value, u0_15.max_global_applications, u0_15.max_user_applications, u0_15.total_usage, u0_15.start_time, u0_15.end_time, u0_15.is_single_use_code
  542.                                                     Index Cond: (u0_15.id = u1_15.voucher_id)
  543.                                                     Filter: ((u0_15.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_15.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_15.status)::text = 'open'::text) AND ((u0_15.voucher_kind)::text = 'static_based'::text) AND (u0_15.min_basket_value = '0'::numeric))
  544.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_15  (cost=0.28..0.35 rows=3 width=16) (never executed)
  545.                                               Output: u2_15.voucherrange_id, u2_15.pack_id
  546.                                               Index Cond: (u2_15.voucherrange_id = u5_5.voucherrange_id)
  547.                                               Heap Fetches: 0
  548.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_15  (cost=0.28..0.33 rows=1 width=8) (never executed)
  549.                                         Output: u3_15.id, u3_15.sku, u3_15.created, u3_15.modified, u3_15.is_active, u3_15.is_default, u3_15.color_id, u3_15.product_id, u3_15.warranty_id
  550.                                         Index Cond: (u3_15.id = u2_15.pack_id)
  551.                                         Filter: (u3_15.product_id = warehouse_product.id)
  552.                     SubPlan 26
  553.                       ->  Limit  (cost=5.69..39.39 rows=1 width=4) (never executed)
  554.                             Output: u0_16.value_percentage_based
  555.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=4) (never executed)
  556.                                   Output: u0_16.value_percentage_based
  557.                                   Inner Unique: true
  558.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=12) (never executed)
  559.                                         Output: u0_16.value_percentage_based, u2_16.pack_id
  560.                                         Join Filter: (u1_16.id = u2_16.voucherrange_id)
  561.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=20) (never executed)
  562.                                               Output: u0_16.value_percentage_based, u1_16.id, u5_6.voucherrange_id
  563.                                               Inner Unique: true
  564.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  565.                                                     Output: u1_16.voucher_id, u1_16.id, u5_6.voucherrange_id
  566.                                                     Inner Unique: true
  567.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  568.                                                           Output: u5_6.voucherrange_id
  569.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_6  (cost=0.28..8.31 rows=2 width=8) (never executed)
  570.                                                                 Output: u6_6.id, u6_6.sku, u6_6.created, u6_6.modified, u6_6.is_active, u6_6.is_default, u6_6.color_id, u6_6.product_id, u6_6.warranty_id
  571.                                                                 Index Cond: (u6_6.product_id = warehouse_product.id)
  572.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_6  (cost=4.30..12.86 rows=3 width=16) (never executed)
  573.                                                                 Output: u5_6.id, u5_6.voucherrange_id, u5_6.pack_id
  574.                                                                 Recheck Cond: (u5_6.pack_id = u6_6.id)
  575.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  576.                                                                       Index Cond: (u5_6.pack_id = u6_6.id)
  577.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_16  (cost=0.28..0.31 rows=1 width=16) (never executed)
  578.                                                           Output: u1_16.id, u1_16.created, u1_16.modified, u1_16.is_include_all_products, u1_16.voucher_id
  579.                                                           Index Cond: (u1_16.id = u5_6.voucherrange_id)
  580.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_16  (cost=0.28..0.54 rows=1 width=12) (never executed)
  581.                                                     Output: u0_16.id, u0_16.title, u0_16.title_en, u0_16.title_fa, u0_16.slug, u0_16.description, u0_16.description_en, u0_16.description_fa, u0_16.created, u0_16.modified, u0_16.voucher_kind, u0_16.voucher_type, u0_16.status, u0_16.value_fixed_price_based_currency, u0_16.value_fixed_price_based, u0_16.value_percentage_based, u0_16.code, u0_16.excel_file, u0_16.min_basket_value_currency, u0_16.min_basket_value, u0_16.max_global_applications, u0_16.max_user_applications, u0_16.total_usage, u0_16.start_time, u0_16.end_time, u0_16.is_single_use_code
  582.                                                     Index Cond: (u0_16.id = u1_16.voucher_id)
  583.                                                     Filter: ((u0_16.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_16.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_16.status)::text = 'open'::text) AND ((u0_16.voucher_kind)::text = 'static_based'::text) AND (u0_16.min_basket_value = '0'::numeric))
  584.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_16  (cost=0.28..0.35 rows=3 width=16) (never executed)
  585.                                               Output: u2_16.voucherrange_id, u2_16.pack_id
  586.                                               Index Cond: (u2_16.voucherrange_id = u5_6.voucherrange_id)
  587.                                               Heap Fetches: 0
  588.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_16  (cost=0.28..0.33 rows=1 width=8) (never executed)
  589.                                         Output: u3_16.id, u3_16.sku, u3_16.created, u3_16.modified, u3_16.is_active, u3_16.is_default, u3_16.color_id, u3_16.product_id, u3_16.warranty_id
  590.                                         Index Cond: (u3_16.id = u2_16.pack_id)
  591.                                         Filter: (u3_16.product_id = warehouse_product.id)
  592.                     SubPlan 28
  593.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (actual time=0.152..0.153 rows=0 loops=1)
  594.                             Output: u3_17.product_id
  595.                             Inner Unique: true
  596.                             Buffers: shared hit=55
  597.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (actual time=0.152..0.152 rows=0 loops=1)
  598.                                   Output: u2_17.pack_id
  599.                                   Buffers: shared hit=55
  600.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (actual time=0.152..0.152 rows=0 loops=1)
  601.                                         Output: u1_17.id
  602.                                         Inner Unique: true
  603.                                         Buffers: shared hit=55
  604.                                         ->  Seq Scan on public.voucher_voucher u0_17  (cost=0.00..77.50 rows=1 width=8) (actual time=0.152..0.152 rows=0 loops=1)
  605.                                               Output: u0_17.id, u0_17.title, u0_17.title_en, u0_17.title_fa, u0_17.slug, u0_17.description, u0_17.description_en, u0_17.description_fa, u0_17.created, u0_17.modified, u0_17.voucher_kind, u0_17.voucher_type, u0_17.status, u0_17.value_fixed_price_based_currency, u0_17.value_fixed_price_based, u0_17.value_percentage_based, u0_17.code, u0_17.excel_file, u0_17.min_basket_value_currency, u0_17.min_basket_value, u0_17.max_global_applications, u0_17.max_user_applications, u0_17.total_usage, u0_17.start_time, u0_17.end_time, u0_17.is_single_use_code
  606.                                               Filter: ((u0_17.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_17.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_17.status)::text = 'open'::text) AND ((u0_17.voucher_kind)::text = 'static_based'::text) AND (u0_17.min_basket_value = '0'::numeric))
  607.                                               Rows Removed by Filter: 1000
  608.                                               Buffers: shared hit=55
  609.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_17  (cost=0.28..8.29 rows=1 width=16) (never executed)
  610.                                               Output: u1_17.id, u1_17.created, u1_17.modified, u1_17.is_include_all_products, u1_17.voucher_id
  611.                                               Index Cond: (u1_17.voucher_id = u0_17.id)
  612.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_17  (cost=0.28..0.39 rows=3 width=16) (never executed)
  613.                                         Output: u2_17.voucherrange_id, u2_17.pack_id
  614.                                         Index Cond: (u2_17.voucherrange_id = u1_17.id)
  615.                                         Heap Fetches: 0
  616.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_17  (cost=0.28..0.33 rows=1 width=16) (never executed)
  617.                                   Output: u3_17.id, u3_17.sku, u3_17.created, u3_17.modified, u3_17.is_active, u3_17.is_default, u3_17.color_id, u3_17.product_id, u3_17.warranty_id
  618.                                   Index Cond: (u3_17.id = u2_17.pack_id)
  619.                     SubPlan 30
  620.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  621.                             Output: u3_18.product_id
  622.                             Inner Unique: true
  623.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  624.                                   Output: u2_18.pack_id
  625.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  626.                                         Output: u1_18.id
  627.                                         Inner Unique: true
  628.                                         ->  Seq Scan on public.voucher_voucher u0_18  (cost=0.00..77.50 rows=1 width=8) (never executed)
  629.                                               Output: u0_18.id, u0_18.title, u0_18.title_en, u0_18.title_fa, u0_18.slug, u0_18.description, u0_18.description_en, u0_18.description_fa, u0_18.created, u0_18.modified, u0_18.voucher_kind, u0_18.voucher_type, u0_18.status, u0_18.value_fixed_price_based_currency, u0_18.value_fixed_price_based, u0_18.value_percentage_based, u0_18.code, u0_18.excel_file, u0_18.min_basket_value_currency, u0_18.min_basket_value, u0_18.max_global_applications, u0_18.max_user_applications, u0_18.total_usage, u0_18.start_time, u0_18.end_time, u0_18.is_single_use_code
  630.                                               Filter: ((u0_18.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_18.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_18.status)::text = 'open'::text) AND ((u0_18.voucher_kind)::text = 'static_based'::text) AND (u0_18.min_basket_value = '0'::numeric))
  631.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_18  (cost=0.28..8.29 rows=1 width=16) (never executed)
  632.                                               Output: u1_18.id, u1_18.created, u1_18.modified, u1_18.is_include_all_products, u1_18.voucher_id
  633.                                               Index Cond: (u1_18.voucher_id = u0_18.id)
  634.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_18  (cost=0.28..0.39 rows=3 width=16) (never executed)
  635.                                         Output: u2_18.voucherrange_id, u2_18.pack_id
  636.                                         Index Cond: (u2_18.voucherrange_id = u1_18.id)
  637.                                         Heap Fetches: 0
  638.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_18  (cost=0.28..0.33 rows=1 width=16) (never executed)
  639.                                   Output: u3_18.id, u3_18.sku, u3_18.created, u3_18.modified, u3_18.is_active, u3_18.is_default, u3_18.color_id, u3_18.product_id, u3_18.warranty_id
  640.                                   Index Cond: (u3_18.id = u2_18.pack_id)
  641.                     SubPlan 31
  642.                       ->  Limit  (cost=5.69..39.39 rows=1 width=11) (never executed)
  643.                             Output: u0_19.voucher_kind
  644.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=11) (never executed)
  645.                                   Output: u0_19.voucher_kind
  646.                                   Inner Unique: true
  647.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=19) (never executed)
  648.                                         Output: u0_19.voucher_kind, u2_19.pack_id
  649.                                         Join Filter: (u1_19.id = u2_19.voucherrange_id)
  650.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=27) (never executed)
  651.                                               Output: u0_19.voucher_kind, u1_19.id, u5_7.voucherrange_id
  652.                                               Inner Unique: true
  653.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  654.                                                     Output: u1_19.voucher_id, u1_19.id, u5_7.voucherrange_id
  655.                                                     Inner Unique: true
  656.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  657.                                                           Output: u5_7.voucherrange_id
  658.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_7  (cost=0.28..8.31 rows=2 width=8) (never executed)
  659.                                                                 Output: u6_7.id, u6_7.sku, u6_7.created, u6_7.modified, u6_7.is_active, u6_7.is_default, u6_7.color_id, u6_7.product_id, u6_7.warranty_id
  660.                                                                 Index Cond: (u6_7.product_id = warehouse_product.id)
  661.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_7  (cost=4.30..12.86 rows=3 width=16) (never executed)
  662.                                                                 Output: u5_7.id, u5_7.voucherrange_id, u5_7.pack_id
  663.                                                                 Recheck Cond: (u5_7.pack_id = u6_7.id)
  664.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  665.                                                                       Index Cond: (u5_7.pack_id = u6_7.id)
  666.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_19  (cost=0.28..0.31 rows=1 width=16) (never executed)
  667.                                                           Output: u1_19.id, u1_19.created, u1_19.modified, u1_19.is_include_all_products, u1_19.voucher_id
  668.                                                           Index Cond: (u1_19.id = u5_7.voucherrange_id)
  669.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_19  (cost=0.28..0.54 rows=1 width=19) (never executed)
  670.                                                     Output: u0_19.id, u0_19.title, u0_19.title_en, u0_19.title_fa, u0_19.slug, u0_19.description, u0_19.description_en, u0_19.description_fa, u0_19.created, u0_19.modified, u0_19.voucher_kind, u0_19.voucher_type, u0_19.status, u0_19.value_fixed_price_based_currency, u0_19.value_fixed_price_based, u0_19.value_percentage_based, u0_19.code, u0_19.excel_file, u0_19.min_basket_value_currency, u0_19.min_basket_value, u0_19.max_global_applications, u0_19.max_user_applications, u0_19.total_usage, u0_19.start_time, u0_19.end_time, u0_19.is_single_use_code
  671.                                                     Index Cond: (u0_19.id = u1_19.voucher_id)
  672.                                                     Filter: ((u0_19.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_19.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_19.status)::text = 'open'::text) AND ((u0_19.voucher_kind)::text = 'static_based'::text) AND (u0_19.min_basket_value = '0'::numeric))
  673.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_19  (cost=0.28..0.35 rows=3 width=16) (never executed)
  674.                                               Output: u2_19.voucherrange_id, u2_19.pack_id
  675.                                               Index Cond: (u2_19.voucherrange_id = u5_7.voucherrange_id)
  676.                                               Heap Fetches: 0
  677.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_19  (cost=0.28..0.33 rows=1 width=8) (never executed)
  678.                                         Output: u3_19.id, u3_19.sku, u3_19.created, u3_19.modified, u3_19.is_active, u3_19.is_default, u3_19.color_id, u3_19.product_id, u3_19.warranty_id
  679.                                         Index Cond: (u3_19.id = u2_19.pack_id)
  680.                                         Filter: (u3_19.product_id = warehouse_product.id)
  681.                     SubPlan 33
  682.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  683.                             Output: u3_20.product_id
  684.                             Inner Unique: true
  685.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  686.                                   Output: u2_20.pack_id
  687.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  688.                                         Output: u1_20.id
  689.                                         Inner Unique: true
  690.                                         ->  Seq Scan on public.voucher_voucher u0_20  (cost=0.00..77.50 rows=1 width=8) (never executed)
  691.                                               Output: u0_20.id, u0_20.title, u0_20.title_en, u0_20.title_fa, u0_20.slug, u0_20.description, u0_20.description_en, u0_20.description_fa, u0_20.created, u0_20.modified, u0_20.voucher_kind, u0_20.voucher_type, u0_20.status, u0_20.value_fixed_price_based_currency, u0_20.value_fixed_price_based, u0_20.value_percentage_based, u0_20.code, u0_20.excel_file, u0_20.min_basket_value_currency, u0_20.min_basket_value, u0_20.max_global_applications, u0_20.max_user_applications, u0_20.total_usage, u0_20.start_time, u0_20.end_time, u0_20.is_single_use_code
  692.                                               Filter: ((u0_20.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_20.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_20.status)::text = 'open'::text) AND ((u0_20.voucher_kind)::text = 'static_based'::text) AND (u0_20.min_basket_value = '0'::numeric))
  693.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_20  (cost=0.28..8.29 rows=1 width=16) (never executed)
  694.                                               Output: u1_20.id, u1_20.created, u1_20.modified, u1_20.is_include_all_products, u1_20.voucher_id
  695.                                               Index Cond: (u1_20.voucher_id = u0_20.id)
  696.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_20  (cost=0.28..0.39 rows=3 width=16) (never executed)
  697.                                         Output: u2_20.voucherrange_id, u2_20.pack_id
  698.                                         Index Cond: (u2_20.voucherrange_id = u1_20.id)
  699.                                         Heap Fetches: 0
  700.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_20  (cost=0.28..0.33 rows=1 width=16) (never executed)
  701.                                   Output: u3_20.id, u3_20.sku, u3_20.created, u3_20.modified, u3_20.is_active, u3_20.is_default, u3_20.color_id, u3_20.product_id, u3_20.warranty_id
  702.                                   Index Cond: (u3_20.id = u2_20.pack_id)
  703.                     SubPlan 34
  704.                       ->  Limit  (cost=5.69..39.39 rows=1 width=17) (never executed)
  705.                             Output: u0_21.voucher_type
  706.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=17) (never executed)
  707.                                   Output: u0_21.voucher_type
  708.                                   Inner Unique: true
  709.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=25) (never executed)
  710.                                         Output: u0_21.voucher_type, u2_21.pack_id
  711.                                         Join Filter: (u1_21.id = u2_21.voucherrange_id)
  712.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=33) (never executed)
  713.                                               Output: u0_21.voucher_type, u1_21.id, u5_8.voucherrange_id
  714.                                               Inner Unique: true
  715.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  716.                                                     Output: u1_21.voucher_id, u1_21.id, u5_8.voucherrange_id
  717.                                                     Inner Unique: true
  718.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  719.                                                           Output: u5_8.voucherrange_id
  720.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_8  (cost=0.28..8.31 rows=2 width=8) (never executed)
  721.                                                                 Output: u6_8.id, u6_8.sku, u6_8.created, u6_8.modified, u6_8.is_active, u6_8.is_default, u6_8.color_id, u6_8.product_id, u6_8.warranty_id
  722.                                                                 Index Cond: (u6_8.product_id = warehouse_product.id)
  723.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_8  (cost=4.30..12.86 rows=3 width=16) (never executed)
  724.                                                                 Output: u5_8.id, u5_8.voucherrange_id, u5_8.pack_id
  725.                                                                 Recheck Cond: (u5_8.pack_id = u6_8.id)
  726.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  727.                                                                       Index Cond: (u5_8.pack_id = u6_8.id)
  728.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_21  (cost=0.28..0.31 rows=1 width=16) (never executed)
  729.                                                           Output: u1_21.id, u1_21.created, u1_21.modified, u1_21.is_include_all_products, u1_21.voucher_id
  730.                                                           Index Cond: (u1_21.id = u5_8.voucherrange_id)
  731.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_21  (cost=0.28..0.54 rows=1 width=25) (never executed)
  732.                                                     Output: u0_21.id, u0_21.title, u0_21.title_en, u0_21.title_fa, u0_21.slug, u0_21.description, u0_21.description_en, u0_21.description_fa, u0_21.created, u0_21.modified, u0_21.voucher_kind, u0_21.voucher_type, u0_21.status, u0_21.value_fixed_price_based_currency, u0_21.value_fixed_price_based, u0_21.value_percentage_based, u0_21.code, u0_21.excel_file, u0_21.min_basket_value_currency, u0_21.min_basket_value, u0_21.max_global_applications, u0_21.max_user_applications, u0_21.total_usage, u0_21.start_time, u0_21.end_time, u0_21.is_single_use_code
  733.                                                     Index Cond: (u0_21.id = u1_21.voucher_id)
  734.                                                     Filter: ((u0_21.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_21.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_21.status)::text = 'open'::text) AND ((u0_21.voucher_kind)::text = 'static_based'::text) AND (u0_21.min_basket_value = '0'::numeric))
  735.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_21  (cost=0.28..0.35 rows=3 width=16) (never executed)
  736.                                               Output: u2_21.voucherrange_id, u2_21.pack_id
  737.                                               Index Cond: (u2_21.voucherrange_id = u5_8.voucherrange_id)
  738.                                               Heap Fetches: 0
  739.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_21  (cost=0.28..0.33 rows=1 width=8) (never executed)
  740.                                         Output: u3_21.id, u3_21.sku, u3_21.created, u3_21.modified, u3_21.is_active, u3_21.is_default, u3_21.color_id, u3_21.product_id, u3_21.warranty_id
  741.                                         Index Cond: (u3_21.id = u2_21.pack_id)
  742.                                         Filter: (u3_21.product_id = warehouse_product.id)
  743.                     SubPlan 35
  744.                       ->  Nested Loop Left Join  (cost=0.56..16.64 rows=1 width=32) (never executed)
  745.                             Output: CASE WHEN ((u2_22.price_currency)::text = 'USD'::text) THEN (u2_22.price * '40000'::numeric) WHEN ((u2_22.price_currency)::text = 'R'::text) THEN (u2_22.price * 0.1) WHEN ((u2_22.price_currency)::text = 'T'::text) THEN (u2_22.price * '1'::numeric) ELSE NULL::numeric END
  746.                             Inner Unique: true
  747.                             ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u0_22  (cost=0.28..8.31 rows=1 width=8) (never executed)
  748.                                   Output: u0_22.id, u0_22.sku, u0_22.created, u0_22.modified, u0_22.is_active, u0_22.is_default, u0_22.color_id, u0_22.product_id, u0_22.warranty_id
  749.                                   Index Cond: (u0_22.product_id = warehouse_product.id)
  750.                                   Filter: u0_22.is_default
  751.                             ->  Index Scan using warehouse_expense_pack_id_key on public.warehouse_expense u2_22  (cost=0.28..8.29 rows=1 width=15) (never executed)
  752.                                   Output: u2_22.id, u2_22.created, u2_22.modified, u2_22.price_currency, u2_22.price, u2_22.buy_price_currency, u2_22.buy_price, u2_22.count_stock, u2_22.actual_count_stock, u2_22.is_suppliable, u2_22.is_threshold, u2_22.threshold, u2_22.pack_id
  753.                                   Index Cond: (u2_22.pack_id = u0_22.id)
  754.                     SubPlan 37
  755.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  756.                             Output: u3_22.product_id
  757.                             Inner Unique: true
  758.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  759.                                   Output: u2_23.pack_id
  760.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  761.                                         Output: u1_22.id
  762.                                         Inner Unique: true
  763.                                         ->  Seq Scan on public.voucher_voucher u0_23  (cost=0.00..77.50 rows=1 width=8) (never executed)
  764.                                               Output: u0_23.id, u0_23.title, u0_23.title_en, u0_23.title_fa, u0_23.slug, u0_23.description, u0_23.description_en, u0_23.description_fa, u0_23.created, u0_23.modified, u0_23.voucher_kind, u0_23.voucher_type, u0_23.status, u0_23.value_fixed_price_based_currency, u0_23.value_fixed_price_based, u0_23.value_percentage_based, u0_23.code, u0_23.excel_file, u0_23.min_basket_value_currency, u0_23.min_basket_value, u0_23.max_global_applications, u0_23.max_user_applications, u0_23.total_usage, u0_23.start_time, u0_23.end_time, u0_23.is_single_use_code
  765.                                               Filter: ((u0_23.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_23.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_23.status)::text = 'open'::text) AND ((u0_23.voucher_kind)::text = 'static_based'::text) AND (u0_23.min_basket_value = '0'::numeric))
  766.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_22  (cost=0.28..8.29 rows=1 width=16) (never executed)
  767.                                               Output: u1_22.id, u1_22.created, u1_22.modified, u1_22.is_include_all_products, u1_22.voucher_id
  768.                                               Index Cond: (u1_22.voucher_id = u0_23.id)
  769.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_23  (cost=0.28..0.39 rows=3 width=16) (never executed)
  770.                                         Output: u2_23.voucherrange_id, u2_23.pack_id
  771.                                         Index Cond: (u2_23.voucherrange_id = u1_22.id)
  772.                                         Heap Fetches: 0
  773.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_22  (cost=0.28..0.33 rows=1 width=16) (never executed)
  774.                                   Output: u3_22.id, u3_22.sku, u3_22.created, u3_22.modified, u3_22.is_active, u3_22.is_default, u3_22.color_id, u3_22.product_id, u3_22.warranty_id
  775.                                   Index Cond: (u3_22.id = u2_23.pack_id)
  776.                     SubPlan 39
  777.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  778.                             Output: u3_23.product_id
  779.                             Inner Unique: true
  780.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  781.                                   Output: u2_24.pack_id
  782.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  783.                                         Output: u1_23.id
  784.                                         Inner Unique: true
  785.                                         ->  Seq Scan on public.voucher_voucher u0_24  (cost=0.00..77.50 rows=1 width=8) (never executed)
  786.                                               Output: u0_24.id, u0_24.title, u0_24.title_en, u0_24.title_fa, u0_24.slug, u0_24.description, u0_24.description_en, u0_24.description_fa, u0_24.created, u0_24.modified, u0_24.voucher_kind, u0_24.voucher_type, u0_24.status, u0_24.value_fixed_price_based_currency, u0_24.value_fixed_price_based, u0_24.value_percentage_based, u0_24.code, u0_24.excel_file, u0_24.min_basket_value_currency, u0_24.min_basket_value, u0_24.max_global_applications, u0_24.max_user_applications, u0_24.total_usage, u0_24.start_time, u0_24.end_time, u0_24.is_single_use_code
  787.                                               Filter: ((u0_24.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_24.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_24.status)::text = 'open'::text) AND ((u0_24.voucher_kind)::text = 'static_based'::text) AND (u0_24.min_basket_value = '0'::numeric))
  788.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_23  (cost=0.28..8.29 rows=1 width=16) (never executed)
  789.                                               Output: u1_23.id, u1_23.created, u1_23.modified, u1_23.is_include_all_products, u1_23.voucher_id
  790.                                               Index Cond: (u1_23.voucher_id = u0_24.id)
  791.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_24  (cost=0.28..0.39 rows=3 width=16) (never executed)
  792.                                         Output: u2_24.voucherrange_id, u2_24.pack_id
  793.                                         Index Cond: (u2_24.voucherrange_id = u1_23.id)
  794.                                         Heap Fetches: 0
  795.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_23  (cost=0.28..0.33 rows=1 width=16) (never executed)
  796.                                   Output: u3_23.id, u3_23.sku, u3_23.created, u3_23.modified, u3_23.is_active, u3_23.is_default, u3_23.color_id, u3_23.product_id, u3_23.warranty_id
  797.                                   Index Cond: (u3_23.id = u2_24.pack_id)
  798.                     SubPlan 40
  799.                       ->  Limit  (cost=5.69..39.39 rows=1 width=11) (never executed)
  800.                             Output: u0_25.voucher_kind
  801.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=11) (never executed)
  802.                                   Output: u0_25.voucher_kind
  803.                                   Inner Unique: true
  804.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=19) (never executed)
  805.                                         Output: u0_25.voucher_kind, u2_25.pack_id
  806.                                         Join Filter: (u1_24.id = u2_25.voucherrange_id)
  807.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=27) (never executed)
  808.                                               Output: u0_25.voucher_kind, u1_24.id, u5_9.voucherrange_id
  809.                                               Inner Unique: true
  810.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  811.                                                     Output: u1_24.voucher_id, u1_24.id, u5_9.voucherrange_id
  812.                                                     Inner Unique: true
  813.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  814.                                                           Output: u5_9.voucherrange_id
  815.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_9  (cost=0.28..8.31 rows=2 width=8) (never executed)
  816.                                                                 Output: u6_9.id, u6_9.sku, u6_9.created, u6_9.modified, u6_9.is_active, u6_9.is_default, u6_9.color_id, u6_9.product_id, u6_9.warranty_id
  817.                                                                 Index Cond: (u6_9.product_id = warehouse_product.id)
  818.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_9  (cost=4.30..12.86 rows=3 width=16) (never executed)
  819.                                                                 Output: u5_9.id, u5_9.voucherrange_id, u5_9.pack_id
  820.                                                                 Recheck Cond: (u5_9.pack_id = u6_9.id)
  821.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  822.                                                                       Index Cond: (u5_9.pack_id = u6_9.id)
  823.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_24  (cost=0.28..0.31 rows=1 width=16) (never executed)
  824.                                                           Output: u1_24.id, u1_24.created, u1_24.modified, u1_24.is_include_all_products, u1_24.voucher_id
  825.                                                           Index Cond: (u1_24.id = u5_9.voucherrange_id)
  826.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_25  (cost=0.28..0.54 rows=1 width=19) (never executed)
  827.                                                     Output: u0_25.id, u0_25.title, u0_25.title_en, u0_25.title_fa, u0_25.slug, u0_25.description, u0_25.description_en, u0_25.description_fa, u0_25.created, u0_25.modified, u0_25.voucher_kind, u0_25.voucher_type, u0_25.status, u0_25.value_fixed_price_based_currency, u0_25.value_fixed_price_based, u0_25.value_percentage_based, u0_25.code, u0_25.excel_file, u0_25.min_basket_value_currency, u0_25.min_basket_value, u0_25.max_global_applications, u0_25.max_user_applications, u0_25.total_usage, u0_25.start_time, u0_25.end_time, u0_25.is_single_use_code
  828.                                                     Index Cond: (u0_25.id = u1_24.voucher_id)
  829.                                                     Filter: ((u0_25.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_25.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_25.status)::text = 'open'::text) AND ((u0_25.voucher_kind)::text = 'static_based'::text) AND (u0_25.min_basket_value = '0'::numeric))
  830.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_25  (cost=0.28..0.35 rows=3 width=16) (never executed)
  831.                                               Output: u2_25.voucherrange_id, u2_25.pack_id
  832.                                               Index Cond: (u2_25.voucherrange_id = u5_9.voucherrange_id)
  833.                                               Heap Fetches: 0
  834.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_24  (cost=0.28..0.33 rows=1 width=8) (never executed)
  835.                                         Output: u3_24.id, u3_24.sku, u3_24.created, u3_24.modified, u3_24.is_active, u3_24.is_default, u3_24.color_id, u3_24.product_id, u3_24.warranty_id
  836.                                         Index Cond: (u3_24.id = u2_25.pack_id)
  837.                                         Filter: (u3_24.product_id = warehouse_product.id)
  838.                     SubPlan 42
  839.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  840.                             Output: u3_25.product_id
  841.                             Inner Unique: true
  842.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  843.                                   Output: u2_26.pack_id
  844.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  845.                                         Output: u1_25.id
  846.                                         Inner Unique: true
  847.                                         ->  Seq Scan on public.voucher_voucher u0_26  (cost=0.00..77.50 rows=1 width=8) (never executed)
  848.                                               Output: u0_26.id, u0_26.title, u0_26.title_en, u0_26.title_fa, u0_26.slug, u0_26.description, u0_26.description_en, u0_26.description_fa, u0_26.created, u0_26.modified, u0_26.voucher_kind, u0_26.voucher_type, u0_26.status, u0_26.value_fixed_price_based_currency, u0_26.value_fixed_price_based, u0_26.value_percentage_based, u0_26.code, u0_26.excel_file, u0_26.min_basket_value_currency, u0_26.min_basket_value, u0_26.max_global_applications, u0_26.max_user_applications, u0_26.total_usage, u0_26.start_time, u0_26.end_time, u0_26.is_single_use_code
  849.                                               Filter: ((u0_26.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_26.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_26.status)::text = 'open'::text) AND ((u0_26.voucher_kind)::text = 'static_based'::text) AND (u0_26.min_basket_value = '0'::numeric))
  850.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_25  (cost=0.28..8.29 rows=1 width=16) (never executed)
  851.                                               Output: u1_25.id, u1_25.created, u1_25.modified, u1_25.is_include_all_products, u1_25.voucher_id
  852.                                               Index Cond: (u1_25.voucher_id = u0_26.id)
  853.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_26  (cost=0.28..0.39 rows=3 width=16) (never executed)
  854.                                         Output: u2_26.voucherrange_id, u2_26.pack_id
  855.                                         Index Cond: (u2_26.voucherrange_id = u1_25.id)
  856.                                         Heap Fetches: 0
  857.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_25  (cost=0.28..0.33 rows=1 width=16) (never executed)
  858.                                   Output: u3_25.id, u3_25.sku, u3_25.created, u3_25.modified, u3_25.is_active, u3_25.is_default, u3_25.color_id, u3_25.product_id, u3_25.warranty_id
  859.                                   Index Cond: (u3_25.id = u2_26.pack_id)
  860.                     SubPlan 43
  861.                       ->  Limit  (cost=5.69..39.39 rows=1 width=17) (never executed)
  862.                             Output: u0_27.voucher_type
  863.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=17) (never executed)
  864.                                   Output: u0_27.voucher_type
  865.                                   Inner Unique: true
  866.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=25) (never executed)
  867.                                         Output: u0_27.voucher_type, u2_27.pack_id
  868.                                         Join Filter: (u1_26.id = u2_27.voucherrange_id)
  869.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=33) (never executed)
  870.                                               Output: u0_27.voucher_type, u1_26.id, u5_10.voucherrange_id
  871.                                               Inner Unique: true
  872.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  873.                                                     Output: u1_26.voucher_id, u1_26.id, u5_10.voucherrange_id
  874.                                                     Inner Unique: true
  875.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  876.                                                           Output: u5_10.voucherrange_id
  877.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_10  (cost=0.28..8.31 rows=2 width=8) (never executed)
  878.                                                                 Output: u6_10.id, u6_10.sku, u6_10.created, u6_10.modified, u6_10.is_active, u6_10.is_default, u6_10.color_id, u6_10.product_id, u6_10.warranty_id
  879.                                                                 Index Cond: (u6_10.product_id = warehouse_product.id)
  880.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_10  (cost=4.30..12.86 rows=3 width=16) (never executed)
  881.                                                                 Output: u5_10.id, u5_10.voucherrange_id, u5_10.pack_id
  882.                                                                 Recheck Cond: (u5_10.pack_id = u6_10.id)
  883.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  884.                                                                       Index Cond: (u5_10.pack_id = u6_10.id)
  885.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_26  (cost=0.28..0.31 rows=1 width=16) (never executed)
  886.                                                           Output: u1_26.id, u1_26.created, u1_26.modified, u1_26.is_include_all_products, u1_26.voucher_id
  887.                                                           Index Cond: (u1_26.id = u5_10.voucherrange_id)
  888.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_27  (cost=0.28..0.54 rows=1 width=25) (never executed)
  889.                                                     Output: u0_27.id, u0_27.title, u0_27.title_en, u0_27.title_fa, u0_27.slug, u0_27.description, u0_27.description_en, u0_27.description_fa, u0_27.created, u0_27.modified, u0_27.voucher_kind, u0_27.voucher_type, u0_27.status, u0_27.value_fixed_price_based_currency, u0_27.value_fixed_price_based, u0_27.value_percentage_based, u0_27.code, u0_27.excel_file, u0_27.min_basket_value_currency, u0_27.min_basket_value, u0_27.max_global_applications, u0_27.max_user_applications, u0_27.total_usage, u0_27.start_time, u0_27.end_time, u0_27.is_single_use_code
  890.                                                     Index Cond: (u0_27.id = u1_26.voucher_id)
  891.                                                     Filter: ((u0_27.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_27.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_27.status)::text = 'open'::text) AND ((u0_27.voucher_kind)::text = 'static_based'::text) AND (u0_27.min_basket_value = '0'::numeric))
  892.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_27  (cost=0.28..0.35 rows=3 width=16) (never executed)
  893.                                               Output: u2_27.voucherrange_id, u2_27.pack_id
  894.                                               Index Cond: (u2_27.voucherrange_id = u5_10.voucherrange_id)
  895.                                               Heap Fetches: 0
  896.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_26  (cost=0.28..0.33 rows=1 width=8) (never executed)
  897.                                         Output: u3_26.id, u3_26.sku, u3_26.created, u3_26.modified, u3_26.is_active, u3_26.is_default, u3_26.color_id, u3_26.product_id, u3_26.warranty_id
  898.                                         Index Cond: (u3_26.id = u2_27.pack_id)
  899.                                         Filter: (u3_26.product_id = warehouse_product.id)
  900.                     SubPlan 44
  901.                       ->  Limit  (cost=5.13..11.77 rows=1 width=6) (never executed)
  902.                             Output: u0_28.value_fixed_price_based
  903.                             ->  Nested Loop  (cost=5.13..38.30 rows=5 width=6) (never executed)
  904.                                   Output: u0_28.value_fixed_price_based
  905.                                   Inner Unique: true
  906.                                   ->  Nested Loop  (cost=4.86..35.64 rows=5 width=8) (never executed)
  907.                                         Output: u1_27.voucher_id
  908.                                         Inner Unique: true
  909.                                         ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  910.                                               Output: u2_28.voucherrange_id
  911.                                               ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u3_27  (cost=0.28..8.31 rows=2 width=8) (never executed)
  912.                                                     Output: u3_27.id, u3_27.sku, u3_27.created, u3_27.modified, u3_27.is_active, u3_27.is_default, u3_27.color_id, u3_27.product_id, u3_27.warranty_id
  913.                                                     Index Cond: (u3_27.product_id = warehouse_product.id)
  914.                                               ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u2_28  (cost=4.30..12.86 rows=3 width=16) (never executed)
  915.                                                     Output: u2_28.id, u2_28.voucherrange_id, u2_28.pack_id
  916.                                                     Recheck Cond: (u2_28.pack_id = u3_27.id)
  917.                                                     ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  918.                                                           Index Cond: (u2_28.pack_id = u3_27.id)
  919.                                         ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_27  (cost=0.28..0.31 rows=1 width=16) (never executed)
  920.                                               Output: u1_27.id, u1_27.created, u1_27.modified, u1_27.is_include_all_products, u1_27.voucher_id
  921.                                               Index Cond: (u1_27.id = u2_28.voucherrange_id)
  922.                                   ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_28  (cost=0.28..0.53 rows=1 width=14) (never executed)
  923.                                         Output: u0_28.id, u0_28.title, u0_28.title_en, u0_28.title_fa, u0_28.slug, u0_28.description, u0_28.description_en, u0_28.description_fa, u0_28.created, u0_28.modified, u0_28.voucher_kind, u0_28.voucher_type, u0_28.status, u0_28.value_fixed_price_based_currency, u0_28.value_fixed_price_based, u0_28.value_percentage_based, u0_28.code, u0_28.excel_file, u0_28.min_basket_value_currency, u0_28.min_basket_value, u0_28.max_global_applications, u0_28.max_user_applications, u0_28.total_usage, u0_28.start_time, u0_28.end_time, u0_28.is_single_use_code
  924.                                         Index Cond: (u0_28.id = u1_27.voucher_id)
  925.                     SubPlan 46
  926.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (actual time=0.155..0.156 rows=0 loops=1)
  927.                             Output: u3_28.product_id
  928.                             Inner Unique: true
  929.                             Buffers: shared hit=55
  930.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (actual time=0.155..0.155 rows=0 loops=1)
  931.                                   Output: u2_29.pack_id
  932.                                   Buffers: shared hit=55
  933.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (actual time=0.155..0.155 rows=0 loops=1)
  934.                                         Output: u1_28.id
  935.                                         Inner Unique: true
  936.                                         Buffers: shared hit=55
  937.                                         ->  Seq Scan on public.voucher_voucher u0_29  (cost=0.00..77.50 rows=1 width=8) (actual time=0.155..0.155 rows=0 loops=1)
  938.                                               Output: u0_29.id, u0_29.title, u0_29.title_en, u0_29.title_fa, u0_29.slug, u0_29.description, u0_29.description_en, u0_29.description_fa, u0_29.created, u0_29.modified, u0_29.voucher_kind, u0_29.voucher_type, u0_29.status, u0_29.value_fixed_price_based_currency, u0_29.value_fixed_price_based, u0_29.value_percentage_based, u0_29.code, u0_29.excel_file, u0_29.min_basket_value_currency, u0_29.min_basket_value, u0_29.max_global_applications, u0_29.max_user_applications, u0_29.total_usage, u0_29.start_time, u0_29.end_time, u0_29.is_single_use_code
  939.                                               Filter: ((u0_29.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_29.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_29.status)::text = 'open'::text) AND ((u0_29.voucher_kind)::text = 'static_based'::text) AND (u0_29.min_basket_value = '0'::numeric))
  940.                                               Rows Removed by Filter: 1000
  941.                                               Buffers: shared hit=55
  942.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_28  (cost=0.28..8.29 rows=1 width=16) (never executed)
  943.                                               Output: u1_28.id, u1_28.created, u1_28.modified, u1_28.is_include_all_products, u1_28.voucher_id
  944.                                               Index Cond: (u1_28.voucher_id = u0_29.id)
  945.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_29  (cost=0.28..0.39 rows=3 width=16) (never executed)
  946.                                         Output: u2_29.voucherrange_id, u2_29.pack_id
  947.                                         Index Cond: (u2_29.voucherrange_id = u1_28.id)
  948.                                         Heap Fetches: 0
  949.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_28  (cost=0.28..0.33 rows=1 width=16) (never executed)
  950.                                   Output: u3_28.id, u3_28.sku, u3_28.created, u3_28.modified, u3_28.is_active, u3_28.is_default, u3_28.color_id, u3_28.product_id, u3_28.warranty_id
  951.                                   Index Cond: (u3_28.id = u2_29.pack_id)
  952.                     SubPlan 48
  953.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  954.                             Output: u3_29.product_id
  955.                             Inner Unique: true
  956.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  957.                                   Output: u2_30.pack_id
  958.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  959.                                         Output: u1_29.id
  960.                                         Inner Unique: true
  961.                                         ->  Seq Scan on public.voucher_voucher u0_30  (cost=0.00..77.50 rows=1 width=8) (never executed)
  962.                                               Output: u0_30.id, u0_30.title, u0_30.title_en, u0_30.title_fa, u0_30.slug, u0_30.description, u0_30.description_en, u0_30.description_fa, u0_30.created, u0_30.modified, u0_30.voucher_kind, u0_30.voucher_type, u0_30.status, u0_30.value_fixed_price_based_currency, u0_30.value_fixed_price_based, u0_30.value_percentage_based, u0_30.code, u0_30.excel_file, u0_30.min_basket_value_currency, u0_30.min_basket_value, u0_30.max_global_applications, u0_30.max_user_applications, u0_30.total_usage, u0_30.start_time, u0_30.end_time, u0_30.is_single_use_code
  963.                                               Filter: ((u0_30.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_30.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_30.status)::text = 'open'::text) AND ((u0_30.voucher_kind)::text = 'static_based'::text) AND (u0_30.min_basket_value = '0'::numeric))
  964.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_29  (cost=0.28..8.29 rows=1 width=16) (never executed)
  965.                                               Output: u1_29.id, u1_29.created, u1_29.modified, u1_29.is_include_all_products, u1_29.voucher_id
  966.                                               Index Cond: (u1_29.voucher_id = u0_30.id)
  967.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_30  (cost=0.28..0.39 rows=3 width=16) (never executed)
  968.                                         Output: u2_30.voucherrange_id, u2_30.pack_id
  969.                                         Index Cond: (u2_30.voucherrange_id = u1_29.id)
  970.                                         Heap Fetches: 0
  971.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_29  (cost=0.28..0.33 rows=1 width=16) (never executed)
  972.                                   Output: u3_29.id, u3_29.sku, u3_29.created, u3_29.modified, u3_29.is_active, u3_29.is_default, u3_29.color_id, u3_29.product_id, u3_29.warranty_id
  973.                                   Index Cond: (u3_29.id = u2_30.pack_id)
  974.                     SubPlan 49
  975.                       ->  Limit  (cost=5.69..39.39 rows=1 width=11) (never executed)
  976.                             Output: u0_31.voucher_kind
  977.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=11) (never executed)
  978.                                   Output: u0_31.voucher_kind
  979.                                   Inner Unique: true
  980.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=19) (never executed)
  981.                                         Output: u0_31.voucher_kind, u2_31.pack_id
  982.                                         Join Filter: (u1_30.id = u2_31.voucherrange_id)
  983.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=27) (never executed)
  984.                                               Output: u0_31.voucher_kind, u1_30.id, u5_11.voucherrange_id
  985.                                               Inner Unique: true
  986.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  987.                                                     Output: u1_30.voucher_id, u1_30.id, u5_11.voucherrange_id
  988.                                                     Inner Unique: true
  989.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  990.                                                           Output: u5_11.voucherrange_id
  991.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_11  (cost=0.28..8.31 rows=2 width=8) (never executed)
  992.                                                                 Output: u6_11.id, u6_11.sku, u6_11.created, u6_11.modified, u6_11.is_active, u6_11.is_default, u6_11.color_id, u6_11.product_id, u6_11.warranty_id
  993.                                                                 Index Cond: (u6_11.product_id = warehouse_product.id)
  994.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_11  (cost=4.30..12.86 rows=3 width=16) (never executed)
  995.                                                                 Output: u5_11.id, u5_11.voucherrange_id, u5_11.pack_id
  996.                                                                 Recheck Cond: (u5_11.pack_id = u6_11.id)
  997.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  998.                                                                       Index Cond: (u5_11.pack_id = u6_11.id)
  999.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_30  (cost=0.28..0.31 rows=1 width=16) (never executed)
  1000.                                                           Output: u1_30.id, u1_30.created, u1_30.modified, u1_30.is_include_all_products, u1_30.voucher_id
  1001.                                                           Index Cond: (u1_30.id = u5_11.voucherrange_id)
  1002.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_31  (cost=0.28..0.54 rows=1 width=19) (never executed)
  1003.                                                     Output: u0_31.id, u0_31.title, u0_31.title_en, u0_31.title_fa, u0_31.slug, u0_31.description, u0_31.description_en, u0_31.description_fa, u0_31.created, u0_31.modified, u0_31.voucher_kind, u0_31.voucher_type, u0_31.status, u0_31.value_fixed_price_based_currency, u0_31.value_fixed_price_based, u0_31.value_percentage_based, u0_31.code, u0_31.excel_file, u0_31.min_basket_value_currency, u0_31.min_basket_value, u0_31.max_global_applications, u0_31.max_user_applications, u0_31.total_usage, u0_31.start_time, u0_31.end_time, u0_31.is_single_use_code
  1004.                                                     Index Cond: (u0_31.id = u1_30.voucher_id)
  1005.                                                     Filter: ((u0_31.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_31.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_31.status)::text = 'open'::text) AND ((u0_31.voucher_kind)::text = 'static_based'::text) AND (u0_31.min_basket_value = '0'::numeric))
  1006.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_31  (cost=0.28..0.35 rows=3 width=16) (never executed)
  1007.                                               Output: u2_31.voucherrange_id, u2_31.pack_id
  1008.                                               Index Cond: (u2_31.voucherrange_id = u5_11.voucherrange_id)
  1009.                                               Heap Fetches: 0
  1010.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_30  (cost=0.28..0.33 rows=1 width=8) (never executed)
  1011.                                         Output: u3_30.id, u3_30.sku, u3_30.created, u3_30.modified, u3_30.is_active, u3_30.is_default, u3_30.color_id, u3_30.product_id, u3_30.warranty_id
  1012.                                         Index Cond: (u3_30.id = u2_31.pack_id)
  1013.                                         Filter: (u3_30.product_id = warehouse_product.id)
  1014.                     SubPlan 51
  1015.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  1016.                             Output: u3_31.product_id
  1017.                             Inner Unique: true
  1018.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  1019.                                   Output: u2_32.pack_id
  1020.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  1021.                                         Output: u1_31.id
  1022.                                         Inner Unique: true
  1023.                                         ->  Seq Scan on public.voucher_voucher u0_32  (cost=0.00..77.50 rows=1 width=8) (never executed)
  1024.                                               Output: u0_32.id, u0_32.title, u0_32.title_en, u0_32.title_fa, u0_32.slug, u0_32.description, u0_32.description_en, u0_32.description_fa, u0_32.created, u0_32.modified, u0_32.voucher_kind, u0_32.voucher_type, u0_32.status, u0_32.value_fixed_price_based_currency, u0_32.value_fixed_price_based, u0_32.value_percentage_based, u0_32.code, u0_32.excel_file, u0_32.min_basket_value_currency, u0_32.min_basket_value, u0_32.max_global_applications, u0_32.max_user_applications, u0_32.total_usage, u0_32.start_time, u0_32.end_time, u0_32.is_single_use_code
  1025.                                               Filter: ((u0_32.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_32.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_32.status)::text = 'open'::text) AND ((u0_32.voucher_kind)::text = 'static_based'::text) AND (u0_32.min_basket_value = '0'::numeric))
  1026.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_31  (cost=0.28..8.29 rows=1 width=16) (never executed)
  1027.                                               Output: u1_31.id, u1_31.created, u1_31.modified, u1_31.is_include_all_products, u1_31.voucher_id
  1028.                                               Index Cond: (u1_31.voucher_id = u0_32.id)
  1029.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_32  (cost=0.28..0.39 rows=3 width=16) (never executed)
  1030.                                         Output: u2_32.voucherrange_id, u2_32.pack_id
  1031.                                         Index Cond: (u2_32.voucherrange_id = u1_31.id)
  1032.                                         Heap Fetches: 0
  1033.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_31  (cost=0.28..0.33 rows=1 width=16) (never executed)
  1034.                                   Output: u3_31.id, u3_31.sku, u3_31.created, u3_31.modified, u3_31.is_active, u3_31.is_default, u3_31.color_id, u3_31.product_id, u3_31.warranty_id
  1035.                                   Index Cond: (u3_31.id = u2_32.pack_id)
  1036.                     SubPlan 52
  1037.                       ->  Limit  (cost=5.69..39.39 rows=1 width=17) (never executed)
  1038.                             Output: u0_33.voucher_type
  1039.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=17) (never executed)
  1040.                                   Output: u0_33.voucher_type
  1041.                                   Inner Unique: true
  1042.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=25) (never executed)
  1043.                                         Output: u0_33.voucher_type, u2_33.pack_id
  1044.                                         Join Filter: (u1_32.id = u2_33.voucherrange_id)
  1045.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=33) (never executed)
  1046.                                               Output: u0_33.voucher_type, u1_32.id, u5_12.voucherrange_id
  1047.                                               Inner Unique: true
  1048.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  1049.                                                     Output: u1_32.voucher_id, u1_32.id, u5_12.voucherrange_id
  1050.                                                     Inner Unique: true
  1051.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  1052.                                                           Output: u5_12.voucherrange_id
  1053.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_12  (cost=0.28..8.31 rows=2 width=8) (never executed)
  1054.                                                                 Output: u6_12.id, u6_12.sku, u6_12.created, u6_12.modified, u6_12.is_active, u6_12.is_default, u6_12.color_id, u6_12.product_id, u6_12.warranty_id
  1055.                                                                 Index Cond: (u6_12.product_id = warehouse_product.id)
  1056.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_12  (cost=4.30..12.86 rows=3 width=16) (never executed)
  1057.                                                                 Output: u5_12.id, u5_12.voucherrange_id, u5_12.pack_id
  1058.                                                                 Recheck Cond: (u5_12.pack_id = u6_12.id)
  1059.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  1060.                                                                       Index Cond: (u5_12.pack_id = u6_12.id)
  1061.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_32  (cost=0.28..0.31 rows=1 width=16) (never executed)
  1062.                                                           Output: u1_32.id, u1_32.created, u1_32.modified, u1_32.is_include_all_products, u1_32.voucher_id
  1063.                                                           Index Cond: (u1_32.id = u5_12.voucherrange_id)
  1064.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_33  (cost=0.28..0.54 rows=1 width=25) (never executed)
  1065.                                                     Output: u0_33.id, u0_33.title, u0_33.title_en, u0_33.title_fa, u0_33.slug, u0_33.description, u0_33.description_en, u0_33.description_fa, u0_33.created, u0_33.modified, u0_33.voucher_kind, u0_33.voucher_type, u0_33.status, u0_33.value_fixed_price_based_currency, u0_33.value_fixed_price_based, u0_33.value_percentage_based, u0_33.code, u0_33.excel_file, u0_33.min_basket_value_currency, u0_33.min_basket_value, u0_33.max_global_applications, u0_33.max_user_applications, u0_33.total_usage, u0_33.start_time, u0_33.end_time, u0_33.is_single_use_code
  1066.                                                     Index Cond: (u0_33.id = u1_32.voucher_id)
  1067.                                                     Filter: ((u0_33.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_33.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_33.status)::text = 'open'::text) AND ((u0_33.voucher_kind)::text = 'static_based'::text) AND (u0_33.min_basket_value = '0'::numeric))
  1068.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_33  (cost=0.28..0.35 rows=3 width=16) (never executed)
  1069.                                               Output: u2_33.voucherrange_id, u2_33.pack_id
  1070.                                               Index Cond: (u2_33.voucherrange_id = u5_12.voucherrange_id)
  1071.                                               Heap Fetches: 0
  1072.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_32  (cost=0.28..0.33 rows=1 width=8) (never executed)
  1073.                                         Output: u3_32.id, u3_32.sku, u3_32.created, u3_32.modified, u3_32.is_active, u3_32.is_default, u3_32.color_id, u3_32.product_id, u3_32.warranty_id
  1074.                                         Index Cond: (u3_32.id = u2_33.pack_id)
  1075.                                         Filter: (u3_32.product_id = warehouse_product.id)
  1076.                     SubPlan 53
  1077.                       ->  Nested Loop Left Join  (cost=0.56..16.64 rows=1 width=32) (never executed)
  1078.                             Output: CASE WHEN ((u2_34.price_currency)::text = 'USD'::text) THEN (u2_34.price * '40000'::numeric) WHEN ((u2_34.price_currency)::text = 'R'::text) THEN (u2_34.price * 0.1) WHEN ((u2_34.price_currency)::text = 'T'::text) THEN (u2_34.price * '1'::numeric) ELSE NULL::numeric END
  1079.                             Inner Unique: true
  1080.                             ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u0_34  (cost=0.28..8.31 rows=1 width=8) (never executed)
  1081.                                   Output: u0_34.id, u0_34.sku, u0_34.created, u0_34.modified, u0_34.is_active, u0_34.is_default, u0_34.color_id, u0_34.product_id, u0_34.warranty_id
  1082.                                   Index Cond: (u0_34.product_id = warehouse_product.id)
  1083.                                   Filter: u0_34.is_default
  1084.                             ->  Index Scan using warehouse_expense_pack_id_key on public.warehouse_expense u2_34  (cost=0.28..8.29 rows=1 width=15) (never executed)
  1085.                                   Output: u2_34.id, u2_34.created, u2_34.modified, u2_34.price_currency, u2_34.price, u2_34.buy_price_currency, u2_34.buy_price, u2_34.count_stock, u2_34.actual_count_stock, u2_34.is_suppliable, u2_34.is_threshold, u2_34.threshold, u2_34.pack_id
  1086.                                   Index Cond: (u2_34.pack_id = u0_34.id)
  1087.                     SubPlan 55
  1088.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  1089.                             Output: u3_33.product_id
  1090.                             Inner Unique: true
  1091.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  1092.                                   Output: u2_35.pack_id
  1093.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  1094.                                         Output: u1_33.id
  1095.                                         Inner Unique: true
  1096.                                         ->  Seq Scan on public.voucher_voucher u0_35  (cost=0.00..77.50 rows=1 width=8) (never executed)
  1097.                                               Output: u0_35.id, u0_35.title, u0_35.title_en, u0_35.title_fa, u0_35.slug, u0_35.description, u0_35.description_en, u0_35.description_fa, u0_35.created, u0_35.modified, u0_35.voucher_kind, u0_35.voucher_type, u0_35.status, u0_35.value_fixed_price_based_currency, u0_35.value_fixed_price_based, u0_35.value_percentage_based, u0_35.code, u0_35.excel_file, u0_35.min_basket_value_currency, u0_35.min_basket_value, u0_35.max_global_applications, u0_35.max_user_applications, u0_35.total_usage, u0_35.start_time, u0_35.end_time, u0_35.is_single_use_code
  1098.                                               Filter: ((u0_35.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_35.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_35.status)::text = 'open'::text) AND ((u0_35.voucher_kind)::text = 'static_based'::text) AND (u0_35.min_basket_value = '0'::numeric))
  1099.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_33  (cost=0.28..8.29 rows=1 width=16) (never executed)
  1100.                                               Output: u1_33.id, u1_33.created, u1_33.modified, u1_33.is_include_all_products, u1_33.voucher_id
  1101.                                               Index Cond: (u1_33.voucher_id = u0_35.id)
  1102.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_35  (cost=0.28..0.39 rows=3 width=16) (never executed)
  1103.                                         Output: u2_35.voucherrange_id, u2_35.pack_id
  1104.                                         Index Cond: (u2_35.voucherrange_id = u1_33.id)
  1105.                                         Heap Fetches: 0
  1106.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_33  (cost=0.28..0.33 rows=1 width=16) (never executed)
  1107.                                   Output: u3_33.id, u3_33.sku, u3_33.created, u3_33.modified, u3_33.is_active, u3_33.is_default, u3_33.color_id, u3_33.product_id, u3_33.warranty_id
  1108.                                   Index Cond: (u3_33.id = u2_35.pack_id)
  1109.                     SubPlan 57
  1110.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  1111.                             Output: u3_34.product_id
  1112.                             Inner Unique: true
  1113.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  1114.                                   Output: u2_36.pack_id
  1115.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  1116.                                         Output: u1_34.id
  1117.                                         Inner Unique: true
  1118.                                         ->  Seq Scan on public.voucher_voucher u0_36  (cost=0.00..77.50 rows=1 width=8) (never executed)
  1119.                                               Output: u0_36.id, u0_36.title, u0_36.title_en, u0_36.title_fa, u0_36.slug, u0_36.description, u0_36.description_en, u0_36.description_fa, u0_36.created, u0_36.modified, u0_36.voucher_kind, u0_36.voucher_type, u0_36.status, u0_36.value_fixed_price_based_currency, u0_36.value_fixed_price_based, u0_36.value_percentage_based, u0_36.code, u0_36.excel_file, u0_36.min_basket_value_currency, u0_36.min_basket_value, u0_36.max_global_applications, u0_36.max_user_applications, u0_36.total_usage, u0_36.start_time, u0_36.end_time, u0_36.is_single_use_code
  1120.                                               Filter: ((u0_36.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_36.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_36.status)::text = 'open'::text) AND ((u0_36.voucher_kind)::text = 'static_based'::text) AND (u0_36.min_basket_value = '0'::numeric))
  1121.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_34  (cost=0.28..8.29 rows=1 width=16) (never executed)
  1122.                                               Output: u1_34.id, u1_34.created, u1_34.modified, u1_34.is_include_all_products, u1_34.voucher_id
  1123.                                               Index Cond: (u1_34.voucher_id = u0_36.id)
  1124.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_36  (cost=0.28..0.39 rows=3 width=16) (never executed)
  1125.                                         Output: u2_36.voucherrange_id, u2_36.pack_id
  1126.                                         Index Cond: (u2_36.voucherrange_id = u1_34.id)
  1127.                                         Heap Fetches: 0
  1128.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_34  (cost=0.28..0.33 rows=1 width=16) (never executed)
  1129.                                   Output: u3_34.id, u3_34.sku, u3_34.created, u3_34.modified, u3_34.is_active, u3_34.is_default, u3_34.color_id, u3_34.product_id, u3_34.warranty_id
  1130.                                   Index Cond: (u3_34.id = u2_36.pack_id)
  1131.                     SubPlan 58
  1132.                       ->  Limit  (cost=5.69..39.39 rows=1 width=11) (never executed)
  1133.                             Output: u0_37.voucher_kind
  1134.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=11) (never executed)
  1135.                                   Output: u0_37.voucher_kind
  1136.                                   Inner Unique: true
  1137.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=19) (never executed)
  1138.                                         Output: u0_37.voucher_kind, u2_37.pack_id
  1139.                                         Join Filter: (u1_35.id = u2_37.voucherrange_id)
  1140.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=27) (never executed)
  1141.                                               Output: u0_37.voucher_kind, u1_35.id, u5_13.voucherrange_id
  1142.                                               Inner Unique: true
  1143.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  1144.                                                     Output: u1_35.voucher_id, u1_35.id, u5_13.voucherrange_id
  1145.                                                     Inner Unique: true
  1146.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  1147.                                                           Output: u5_13.voucherrange_id
  1148.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_13  (cost=0.28..8.31 rows=2 width=8) (never executed)
  1149.                                                                 Output: u6_13.id, u6_13.sku, u6_13.created, u6_13.modified, u6_13.is_active, u6_13.is_default, u6_13.color_id, u6_13.product_id, u6_13.warranty_id
  1150.                                                                 Index Cond: (u6_13.product_id = warehouse_product.id)
  1151.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_13  (cost=4.30..12.86 rows=3 width=16) (never executed)
  1152.                                                                 Output: u5_13.id, u5_13.voucherrange_id, u5_13.pack_id
  1153.                                                                 Recheck Cond: (u5_13.pack_id = u6_13.id)
  1154.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  1155.                                                                       Index Cond: (u5_13.pack_id = u6_13.id)
  1156.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_35  (cost=0.28..0.31 rows=1 width=16) (never executed)
  1157.                                                           Output: u1_35.id, u1_35.created, u1_35.modified, u1_35.is_include_all_products, u1_35.voucher_id
  1158.                                                           Index Cond: (u1_35.id = u5_13.voucherrange_id)
  1159.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_37  (cost=0.28..0.54 rows=1 width=19) (never executed)
  1160.                                                     Output: u0_37.id, u0_37.title, u0_37.title_en, u0_37.title_fa, u0_37.slug, u0_37.description, u0_37.description_en, u0_37.description_fa, u0_37.created, u0_37.modified, u0_37.voucher_kind, u0_37.voucher_type, u0_37.status, u0_37.value_fixed_price_based_currency, u0_37.value_fixed_price_based, u0_37.value_percentage_based, u0_37.code, u0_37.excel_file, u0_37.min_basket_value_currency, u0_37.min_basket_value, u0_37.max_global_applications, u0_37.max_user_applications, u0_37.total_usage, u0_37.start_time, u0_37.end_time, u0_37.is_single_use_code
  1161.                                                     Index Cond: (u0_37.id = u1_35.voucher_id)
  1162.                                                     Filter: ((u0_37.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_37.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_37.status)::text = 'open'::text) AND ((u0_37.voucher_kind)::text = 'static_based'::text) AND (u0_37.min_basket_value = '0'::numeric))
  1163.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_37  (cost=0.28..0.35 rows=3 width=16) (never executed)
  1164.                                               Output: u2_37.voucherrange_id, u2_37.pack_id
  1165.                                               Index Cond: (u2_37.voucherrange_id = u5_13.voucherrange_id)
  1166.                                               Heap Fetches: 0
  1167.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_35  (cost=0.28..0.33 rows=1 width=8) (never executed)
  1168.                                         Output: u3_35.id, u3_35.sku, u3_35.created, u3_35.modified, u3_35.is_active, u3_35.is_default, u3_35.color_id, u3_35.product_id, u3_35.warranty_id
  1169.                                         Index Cond: (u3_35.id = u2_37.pack_id)
  1170.                                         Filter: (u3_35.product_id = warehouse_product.id)
  1171.                     SubPlan 60
  1172.                       ->  Nested Loop  (cost=0.83..87.21 rows=3 width=8) (never executed)
  1173.                             Output: u3_36.product_id
  1174.                             Inner Unique: true
  1175.                             ->  Nested Loop  (cost=0.56..86.23 rows=3 width=8) (never executed)
  1176.                                   Output: u2_38.pack_id
  1177.                                   ->  Nested Loop  (cost=0.28..85.81 rows=1 width=8) (never executed)
  1178.                                         Output: u1_36.id
  1179.                                         Inner Unique: true
  1180.                                         ->  Seq Scan on public.voucher_voucher u0_38  (cost=0.00..77.50 rows=1 width=8) (never executed)
  1181.                                               Output: u0_38.id, u0_38.title, u0_38.title_en, u0_38.title_fa, u0_38.slug, u0_38.description, u0_38.description_en, u0_38.description_fa, u0_38.created, u0_38.modified, u0_38.voucher_kind, u0_38.voucher_type, u0_38.status, u0_38.value_fixed_price_based_currency, u0_38.value_fixed_price_based, u0_38.value_percentage_based, u0_38.code, u0_38.excel_file, u0_38.min_basket_value_currency, u0_38.min_basket_value, u0_38.max_global_applications, u0_38.max_user_applications, u0_38.total_usage, u0_38.start_time, u0_38.end_time, u0_38.is_single_use_code
  1182.                                               Filter: ((u0_38.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_38.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_38.status)::text = 'open'::text) AND ((u0_38.voucher_kind)::text = 'static_based'::text) AND (u0_38.min_basket_value = '0'::numeric))
  1183.                                         ->  Index Scan using voucher_voucherrange_voucher_id_key on public.voucher_voucherrange u1_36  (cost=0.28..8.29 rows=1 width=16) (never executed)
  1184.                                               Output: u1_36.id, u1_36.created, u1_36.modified, u1_36.is_include_all_products, u1_36.voucher_id
  1185.                                               Index Cond: (u1_36.voucher_id = u0_38.id)
  1186.                                   ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_38  (cost=0.28..0.39 rows=3 width=16) (never executed)
  1187.                                         Output: u2_38.voucherrange_id, u2_38.pack_id
  1188.                                         Index Cond: (u2_38.voucherrange_id = u1_36.id)
  1189.                                         Heap Fetches: 0
  1190.                             ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_36  (cost=0.28..0.33 rows=1 width=16) (never executed)
  1191.                                   Output: u3_36.id, u3_36.sku, u3_36.created, u3_36.modified, u3_36.is_active, u3_36.is_default, u3_36.color_id, u3_36.product_id, u3_36.warranty_id
  1192.                                   Index Cond: (u3_36.id = u2_38.pack_id)
  1193.                     SubPlan 61
  1194.                       ->  Limit  (cost=5.69..39.39 rows=1 width=17) (never executed)
  1195.                             Output: u0_39.voucher_type
  1196.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=17) (never executed)
  1197.                                   Output: u0_39.voucher_type
  1198.                                   Inner Unique: true
  1199.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=25) (never executed)
  1200.                                         Output: u0_39.voucher_type, u2_39.pack_id
  1201.                                         Join Filter: (u1_37.id = u2_39.voucherrange_id)
  1202.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=33) (never executed)
  1203.                                               Output: u0_39.voucher_type, u1_37.id, u5_14.voucherrange_id
  1204.                                               Inner Unique: true
  1205.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  1206.                                                     Output: u1_37.voucher_id, u1_37.id, u5_14.voucherrange_id
  1207.                                                     Inner Unique: true
  1208.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  1209.                                                           Output: u5_14.voucherrange_id
  1210.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_14  (cost=0.28..8.31 rows=2 width=8) (never executed)
  1211.                                                                 Output: u6_14.id, u6_14.sku, u6_14.created, u6_14.modified, u6_14.is_active, u6_14.is_default, u6_14.color_id, u6_14.product_id, u6_14.warranty_id
  1212.                                                                 Index Cond: (u6_14.product_id = warehouse_product.id)
  1213.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_14  (cost=4.30..12.86 rows=3 width=16) (never executed)
  1214.                                                                 Output: u5_14.id, u5_14.voucherrange_id, u5_14.pack_id
  1215.                                                                 Recheck Cond: (u5_14.pack_id = u6_14.id)
  1216.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  1217.                                                                       Index Cond: (u5_14.pack_id = u6_14.id)
  1218.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_37  (cost=0.28..0.31 rows=1 width=16) (never executed)
  1219.                                                           Output: u1_37.id, u1_37.created, u1_37.modified, u1_37.is_include_all_products, u1_37.voucher_id
  1220.                                                           Index Cond: (u1_37.id = u5_14.voucherrange_id)
  1221.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_39  (cost=0.28..0.54 rows=1 width=25) (never executed)
  1222.                                                     Output: u0_39.id, u0_39.title, u0_39.title_en, u0_39.title_fa, u0_39.slug, u0_39.description, u0_39.description_en, u0_39.description_fa, u0_39.created, u0_39.modified, u0_39.voucher_kind, u0_39.voucher_type, u0_39.status, u0_39.value_fixed_price_based_currency, u0_39.value_fixed_price_based, u0_39.value_percentage_based, u0_39.code, u0_39.excel_file, u0_39.min_basket_value_currency, u0_39.min_basket_value, u0_39.max_global_applications, u0_39.max_user_applications, u0_39.total_usage, u0_39.start_time, u0_39.end_time, u0_39.is_single_use_code
  1223.                                                     Index Cond: (u0_39.id = u1_37.voucher_id)
  1224.                                                     Filter: ((u0_39.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_39.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_39.status)::text = 'open'::text) AND ((u0_39.voucher_kind)::text = 'static_based'::text) AND (u0_39.min_basket_value = '0'::numeric))
  1225.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_39  (cost=0.28..0.35 rows=3 width=16) (never executed)
  1226.                                               Output: u2_39.voucherrange_id, u2_39.pack_id
  1227.                                               Index Cond: (u2_39.voucherrange_id = u5_14.voucherrange_id)
  1228.                                               Heap Fetches: 0
  1229.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_37  (cost=0.28..0.33 rows=1 width=8) (never executed)
  1230.                                         Output: u3_37.id, u3_37.sku, u3_37.created, u3_37.modified, u3_37.is_active, u3_37.is_default, u3_37.color_id, u3_37.product_id, u3_37.warranty_id
  1231.                                         Index Cond: (u3_37.id = u2_39.pack_id)
  1232.                                         Filter: (u3_37.product_id = warehouse_product.id)
  1233.                     SubPlan 62
  1234.                       ->  Limit  (cost=5.69..39.39 rows=1 width=4) (never executed)
  1235.                             Output: u0_40.value_percentage_based
  1236.                             ->  Nested Loop  (cost=5.69..39.39 rows=1 width=4) (never executed)
  1237.                                   Output: u0_40.value_percentage_based
  1238.                                   Inner Unique: true
  1239.                                   ->  Nested Loop  (cost=5.41..39.02 rows=1 width=12) (never executed)
  1240.                                         Output: u0_40.value_percentage_based, u2_40.pack_id
  1241.                                         Join Filter: (u1_38.id = u2_40.voucherrange_id)
  1242.                                         ->  Nested Loop  (cost=5.13..38.63 rows=1 width=20) (never executed)
  1243.                                               Output: u0_40.value_percentage_based, u1_38.id, u5_15.voucherrange_id
  1244.                                               Inner Unique: true
  1245.                                               ->  Nested Loop  (cost=4.86..35.64 rows=5 width=24) (never executed)
  1246.                                                     Output: u1_38.voucher_id, u1_38.id, u5_15.voucherrange_id
  1247.                                                     Inner Unique: true
  1248.                                                     ->  Nested Loop  (cost=4.58..34.08 rows=5 width=8) (never executed)
  1249.                                                           Output: u5_15.voucherrange_id
  1250.                                                           ->  Index Scan using warehouse_pack_product_id_8bbe7714 on public.warehouse_pack u6_15  (cost=0.28..8.31 rows=2 width=8) (never executed)
  1251.                                                                 Output: u6_15.id, u6_15.sku, u6_15.created, u6_15.modified, u6_15.is_active, u6_15.is_default, u6_15.color_id, u6_15.product_id, u6_15.warranty_id
  1252.                                                                 Index Cond: (u6_15.product_id = warehouse_product.id)
  1253.                                                           ->  Bitmap Heap Scan on public.voucher_voucherrange_packs u5_15  (cost=4.30..12.86 rows=3 width=16) (never executed)
  1254.                                                                 Output: u5_15.id, u5_15.voucherrange_id, u5_15.pack_id
  1255.                                                                 Recheck Cond: (u5_15.pack_id = u6_15.id)
  1256.                                                                 ->  Bitmap Index Scan on voucher_voucherrange_packs_pack_id_c3b65611  (cost=0.00..4.30 rows=3 width=0) (never executed)
  1257.                                                                       Index Cond: (u5_15.pack_id = u6_15.id)
  1258.                                                     ->  Index Scan using voucher_voucherrange_pkey on public.voucher_voucherrange u1_38  (cost=0.28..0.31 rows=1 width=16) (never executed)
  1259.                                                           Output: u1_38.id, u1_38.created, u1_38.modified, u1_38.is_include_all_products, u1_38.voucher_id
  1260.                                                           Index Cond: (u1_38.id = u5_15.voucherrange_id)
  1261.                                               ->  Index Scan using voucher_voucher_pkey on public.voucher_voucher u0_40  (cost=0.28..0.54 rows=1 width=12) (never executed)
  1262.                                                     Output: u0_40.id, u0_40.title, u0_40.title_en, u0_40.title_fa, u0_40.slug, u0_40.description, u0_40.description_en, u0_40.description_fa, u0_40.created, u0_40.modified, u0_40.voucher_kind, u0_40.voucher_type, u0_40.status, u0_40.value_fixed_price_based_currency, u0_40.value_fixed_price_based, u0_40.value_percentage_based, u0_40.code, u0_40.excel_file, u0_40.min_basket_value_currency, u0_40.min_basket_value, u0_40.max_global_applications, u0_40.max_user_applications, u0_40.total_usage, u0_40.start_time, u0_40.end_time, u0_40.is_single_use_code
  1263.                                                     Index Cond: (u0_40.id = u1_38.voucher_id)
  1264.                                                     Filter: ((u0_40.end_time >= '2023-05-17 11:29:56.828165+00'::timestamp with time zone) AND (u0_40.start_time <= '2023-05-17 11:29:56.82816+00'::timestamp with time zone) AND ((u0_40.status)::text = 'open'::text) AND ((u0_40.voucher_kind)::text = 'static_based'::text) AND (u0_40.min_basket_value = '0'::numeric))
  1265.                                         ->  Index Only Scan using voucher_voucherrange_pac_voucherrange_id_pack_id_bc84c0ab_uniq on public.voucher_voucherrange_packs u2_40  (cost=0.28..0.35 rows=3 width=16) (never executed)
  1266.                                               Output: u2_40.voucherrange_id, u2_40.pack_id
  1267.                                               Index Cond: (u2_40.voucherrange_id = u5_15.voucherrange_id)
  1268.                                               Heap Fetches: 0
  1269.                                   ->  Index Scan using warehouse_pack_pkey on public.warehouse_pack u3_38  (cost=0.28..0.33 rows=1 width=8) (never executed)
  1270.                                         Output: u3_38.id, u3_38.sku, u3_38.created, u3_38.modified, u3_38.is_active, u3_38.is_default, u3_38.color_id, u3_38.product_id, u3_38.warranty_id
  1271.                                         Index Cond: (u3_38.id = u2_40.pack_id)
  1272.                                         Filter: (u3_38.product_id = warehouse_product.id)
  1273. Planning:
  1274.   Buffers: shared hit=5833
  1275. Planning Time: 81.651 ms
  1276. Execution Time: 4.655 ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement