explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cLW1

Settings
# exclusive inclusive rows x rows loops node
1. 0.176 60,583.485 ↑ 2,964.9 36 1

Sort (cost=3,086,290.61..3,086,557.45 rows=106,736 width=616) (actual time=60,583.481..60,583.485 rows=36 loops=1)

  • Sort Key: (((o.documentno)::text || ' 1'::text))
  • Sort Method: quicksort Memory: 36kB
2.          

CTE ipayment

3. 2,789.205 4,353.600 ↑ 30.6 100,860 1

Hash Left Join (cost=41,927.18..620,155.80 rows=3,083,318 width=59) (actual time=633.794..4,353.600 rows=100,860 loops=1)

  • Hash Cond: (cb.c_currency_id = cr.c_currency_id_to)
  • Join Filter: ((cr.validfrom <= c.dateacct) AND (cr.validto >= c.dateacct))
  • Rows Removed by Join Filter: 12378358
4. 43.041 1,553.994 ↓ 3.4 100,860 1

Hash Left Join (cost=41,311.87..82,973.26 rows=30,010 width=40) (actual time=623.299..1,553.994 rows=100,860 loops=1)

  • Hash Cond: (c.c_cashbook_id = cb.c_cashbook_id)
5. 95.995 1,510.550 ↓ 3.4 100,860 1

Hash Join (cost=41,281.52..82,530.27 rows=30,010 width=41) (actual time=622.867..1,510.550 rows=100,860 loops=1)

  • Hash Cond: (cl.c_cash_id = c.c_cash_id)
6. 18.917 1,242.601 ↓ 3.4 100,866 1

Nested Loop (cost=31,168.62..70,654.64 rows=30,034 width=26) (actual time=449.973..1,242.601 rows=100,866 loops=1)

7. 92.775 718.639 ↓ 3.4 101,009 1

Hash Join (cost=31,168.19..41,765.31 rows=30,034 width=19) (actual time=449.917..718.639 rows=101,009 loops=1)

  • Hash Cond: (al.c_allocationhdr_id = ah.c_allocationhdr_id)
8. 129.368 432.839 ↓ 3.4 103,470 1

Hash Join (cost=17,937.70..26,848.03 rows=30,788 width=25) (actual time=255.501..432.839 rows=103,470 loops=1)

  • Hash Cond: (al.c_invoice_id = i2.c_invoice_id)
9. 48.193 48.193 ↓ 1.0 240,693 1

Seq Scan on c_allocationline al (cost=0.00..7,699.89 rows=240,689 width=25) (actual time=0.009..48.193 rows=240,693 loops=1)

10. 28.329 255.278 ↓ 2.8 90,685 1

Hash (cost=17,531.01..17,531.01 rows=32,535 width=6) (actual time=255.278..255.278 rows=90,685 loops=1)

  • Buckets: 131072 (originally 32768) Batches: 1 (originally 1) Memory Usage: 4478kB
11. 208.283 226.949 ↓ 2.8 90,685 1

Bitmap Heap Scan on c_invoice i2 (cost=2,251.08..17,531.01 rows=32,535 width=6) (actual time=20.695..226.949 rows=90,685 loops=1)

  • Recheck Cond: (c_doctypetarget_id = ANY ('{1000005,1000156,1000158}'::numeric[]))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND ((dateinvoiced)::date <= ('now'::cstring)::date))
  • Rows Removed by Filter: 20742
  • Heap Blocks: exact=10945
12. 18.666 18.666 ↓ 1.0 111,504 1

Bitmap Index Scan on art_c_invoice_issotrx_doc_status (cost=0.00..2,242.95 rows=110,626 width=0) (actual time=18.666..18.666 rows=111,504 loops=1)

  • Index Cond: (c_doctypetarget_id = ANY ('{1000005,1000156,1000158}'::numeric[]))
13. 66.147 193.025 ↓ 1.0 217,409 1

Hash (cost=9,666.03..9,666.03 rows=217,237 width=6) (actual time=193.025..193.025 rows=217,409 loops=1)

  • Buckets: 262144 Batches: 2 Memory Usage: 6202kB
14. 126.878 126.878 ↓ 1.0 217,409 1

Seq Scan on c_allocationhdr ah (cost=0.00..9,666.03 rows=217,237 width=6) (actual time=0.031..126.878 rows=217,409 loops=1)

  • Filter: (docstatus <> ALL ('{VO,RE,--}'::bpchar[]))
  • Rows Removed by Filter: 5286
15. 505.045 505.045 ↑ 1.0 1 101,009

Index Scan using c_cashline_pkey on c_cashline cl (cost=0.42..0.95 rows=1 width=13) (actual time=0.004..0.005 rows=1 loops=101,009)

  • Index Cond: (c_cashline_id = al.c_cashline_id)
16. 62.422 171.954 ↑ 1.0 137,058 1

Hash (cost=7,461.14..7,461.14 rows=137,101 width=28) (actual time=171.954..171.954 rows=137,058 loops=1)

  • Buckets: 131072 Batches: 2 Memory Usage: 5229kB
17. 109.532 109.532 ↑ 1.0 137,058 1

Seq Scan on c_cash c (cost=0.00..7,461.14 rows=137,101 width=28) (actual time=0.028..109.532 rows=137,058 loops=1)

  • Filter: (docstatus = ANY ('{CO,CL}'::bpchar[]))
  • Rows Removed by Filter: 106
18. 0.130 0.403 ↑ 1.0 549 1

Hash (cost=23.49..23.49 rows=549 width=11) (actual time=0.403..0.403 rows=549 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 32kB
19. 0.273 0.273 ↑ 1.0 549 1

Seq Scan on c_cashbook cb (cost=0.00..23.49 rows=549 width=11) (actual time=0.008..0.273 rows=549 loops=1)

20. 3.771 10.401 ↑ 1.0 13,565 1

Hash (cost=445.75..445.75 rows=13,565 width=28) (actual time=10.400..10.401 rows=13,565 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 986kB
21. 6.630 6.630 ↑ 1.0 13,565 1

Seq Scan on c_conversion_rate cr (cost=0.00..445.75 rows=13,565 width=28) (actual time=0.021..6.630 rows=13,565 loops=1)

  • Filter: (c_currency_id = '341'::numeric)
  • Rows Removed by Filter: 15
22.          

CTE w_invoice

23. 119.215 305.029 ↓ 2.4 96,132 1

GroupAggregate (cost=781,088.47..858,971.42 rows=40,000 width=112) (actual time=170.676..305.029 rows=96,132 loops=1)

  • Group Key: ip.c_invoice_id, (to_char(ip.statementdate, 'YYYY.MM.DD'::text))
24. 108.401 185.814 ↑ 30.6 100,860 1

Sort (cost=781,088.47..788,796.77 rows=3,083,318 width=120) (actual time=170.642..185.814 rows=100,860 loops=1)

  • Sort Key: ip.c_invoice_id, (to_char(ip.statementdate, 'YYYY.MM.DD'::text))
  • Sort Method: external merge Disk: 4736kB
25. 77.413 77.413 ↑ 30.6 100,860 1

CTE Scan on ipayment ip (cost=0.00..69,374.65 rows=3,083,318 width=120) (actual time=0.045..77.413 rows=100,860 loops=1)

26.          

CTE w_order

27. 64.573 4,956.605 ↑ 9.5 49,440 1

GroupAggregate (cost=1,358,078.76..1,395,935.90 rows=468,264 width=78) (actual time=4,878.883..4,956.605 rows=49,440 loops=1)

  • Group Key: t.c_order_id, t.lastpaydate
28. 67.416 4,892.032 ↑ 30.6 100,860 1

Sort (cost=1,358,078.76..1,365,787.06 rows=3,083,318 width=46) (actual time=4,878.709..4,892.032 rows=100,860 loops=1)

  • Sort Key: t.c_order_id, t.lastpaydate
  • Sort Method: external sort Disk: 3008kB
29. 8.888 4,824.616 ↑ 30.6 100,860 1

Subquery Scan on t (cost=815,283.52..930,907.94 rows=3,083,318 width=46) (actual time=4,732.650..4,824.616 rows=100,860 loops=1)

30. 72.107 4,815.728 ↑ 30.6 100,860 1

WindowAgg (cost=815,283.52..900,074.76 rows=3,083,318 width=46) (actual time=4,732.648..4,815.728 rows=100,860 loops=1)

31. 83.402 4,743.621 ↑ 30.6 100,860 1

Sort (cost=815,283.52..822,991.81 rows=3,083,318 width=78) (actual time=4,732.623..4,743.621 rows=100,860 loops=1)

  • Sort Key: i_4.c_order_id
  • Sort Method: external merge Disk: 3168kB
32. 92.168 4,660.219 ↑ 30.6 100,860 1

Hash Join (cost=19,340.72..208,954.70 rows=3,083,318 width=78) (actual time=797.322..4,660.219 rows=100,860 loops=1)

  • Hash Cond: (ip_1.c_invoice_id = i_4.c_invoice_id)
33. 4,406.091 4,406.091 ↑ 30.6 100,860 1

CTE Scan on ipayment ip_1 (cost=0.00..61,666.36 rows=3,083,318 width=88) (actual time=633.797..4,406.091 rows=100,860 loops=1)

34. 70.391 161.960 ↑ 1.0 254,343 1

Hash (cost=14,919.43..14,919.43 rows=254,343 width=12) (actual time=161.960..161.960 rows=254,343 loops=1)

  • Buckets: 262144 Batches: 2 Memory Usage: 7167kB
35. 91.569 91.569 ↑ 1.0 254,343 1

Seq Scan on c_invoice i_4 (cost=0.00..14,919.43 rows=254,343 width=12) (actual time=0.017..91.569 rows=254,343 loops=1)

36.          

CTE buy

37. 28.102 157.202 ↓ 103.3 25,617 1

Nested Loop Left Join (cost=0.42..9,479.51 rows=248 width=33) (actual time=0.030..157.202 rows=25,617 loops=1)

38. 49.768 49.768 ↓ 183.6 13,222 1

Seq Scan on c_order buy_1 (cost=0.00..7,828.87 rows=72 width=13) (actual time=0.011..49.768 rows=13,222 loops=1)

  • Filter: ((c_doctype_id = ANY ('{1000160,1000016}'::numeric[])) AND (docstatus = ANY ('{CO,CL}'::bpchar[])) AND (COALESCE(issotrx, 'N'::bpchar) = 'N'::bpchar))
  • Rows Removed by Filter: 70060
39. 79.332 79.332 ↑ 4.5 2 13,222

Index Scan using c_orderline_order on c_orderline buyl (cost=0.42..22.84 rows=9 width=26) (actual time=0.005..0.006 rows=2 loops=13,222)

  • Index Cond: (c_order_id = buy_1.c_order_id)
40. 0.008 60,583.309 ↑ 2,964.9 36 1

Append (cost=92,032.57..162,579.69 rows=106,736 width=616) (actual time=5,077.362..60,583.309 rows=36 loops=1)

41. 6.730 5,077.711 ↑ 5,629.1 18 1

Merge Right Join (cost=92,032.57..97,413.58 rows=101,323 width=634) (actual time=5,077.362..5,077.711 rows=18 loops=1)

  • Merge Cond: (wo.c_order_id = o.c_order_id)
42. 14.356 4,985.743 ↑ 9.5 49,440 1

Sort (cost=74,276.14..75,446.80 rows=468,264 width=80) (actual time=4,982.500..4,985.743 rows=49,440 loops=1)

  • Sort Key: wo.c_order_id
  • Sort Method: quicksort Memory: 5399kB
43. 4,971.387 4,971.387 ↑ 9.5 49,440 1

CTE Scan on w_order wo (cost=0.00..9,365.28 rows=468,264 width=80) (actual time=4,878.887..4,971.387 rows=49,440 loops=1)

44. 0.029 85.238 ↑ 1,001.4 18 1

Sort (cost=17,756.43..17,801.50 rows=18,026 width=321) (actual time=85.238..85.238 rows=18 loops=1)

  • Sort Key: o.c_order_id
  • Sort Method: quicksort Memory: 34kB
45. 3.044 85.209 ↑ 1,001.4 18 1

Hash Right Join (cost=13,365.50..16,482.19 rows=18,026 width=321) (actual time=84.963..85.209 rows=18 loops=1)

  • Hash Cond: (cor.c_currency_id_to = COALESCE(pl.c_currencyto_id, pl.c_currency_id))
  • Join Filter: ((cor.validfrom <= o.dateordered) AND (cor.validto >= o.dateordered))
  • Rows Removed by Join Filter: 5181
46. 4.158 4.158 ↑ 1.0 13,565 1

Seq Scan on c_conversion_rate cor (cost=0.00..445.75 rows=13,565 width=28) (actual time=0.014..4.158 rows=13,565 loops=1)

  • Filter: (c_currency_id = '341'::numeric)
  • Rows Removed by Filter: 15
47. 0.025 78.007 ↑ 16.6 18 1

Hash (cost=13,361.76..13,361.76 rows=299 width=346) (actual time=78.007..78.007 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
48. 0.016 77.982 ↑ 16.6 18 1

Nested Loop Left Join (cost=52.44..13,361.76 rows=299 width=346) (actual time=1.645..77.982 rows=18 loops=1)

49. 0.025 77.840 ↑ 16.6 18 1

Nested Loop Left Join (cost=52.15..13,264.36 rows=299 width=293) (actual time=1.619..77.840 rows=18 loops=1)

50. 0.009 77.725 ↑ 4.8 18 1

Nested Loop Left Join (cost=51.73..11,276.66 rows=87 width=278) (actual time=1.589..77.725 rows=18 loops=1)

51. 0.021 77.662 ↑ 4.8 18 1

Nested Loop Left Join (cost=51.59..11,241.66 rows=87 width=279) (actual time=1.572..77.662 rows=18 loops=1)

52. 0.018 77.587 ↑ 4.8 18 1

Nested Loop Left Join (cost=51.30..10,662.25 rows=87 width=242) (actual time=1.566..77.587 rows=18 loops=1)

53. 0.010 77.515 ↑ 4.8 18 1

Nested Loop Left Join (cost=51.01..10,596.87 rows=87 width=204) (actual time=1.549..77.515 rows=18 loops=1)

54. 0.038 77.433 ↑ 4.8 18 1

Nested Loop Left Join (cost=50.73..10,117.69 rows=87 width=204) (actual time=1.524..77.433 rows=18 loops=1)

55. 0.008 77.359 ↑ 4.8 18 1

Nested Loop Left Join (cost=50.59..10,091.33 rows=87 width=177) (actual time=1.507..77.359 rows=18 loops=1)

56. 0.090 76.865 ↑ 4.8 18 1

Nested Loop Left Join (cost=49.32..9,330.53 rows=87 width=151) (actual time=1.367..76.865 rows=18 loops=1)

  • Join Filter: (bp.c_bpartner_id = o.c_bpartner_company_id)
  • Rows Removed by Join Filter: 450
57. 0.025 76.325 ↑ 4.8 18 1

Nested Loop Left Join (cost=47.19..9,094.24 rows=87 width=151) (actual time=1.057..76.325 rows=18 loops=1)

  • Join Filter: ((rl.value)::bpchar = o.docstatus)
  • Rows Removed by Join Filter: 198
58. 0.027 75.922 ↑ 4.8 18 1

Nested Loop Left Join (cost=23.22..9,009.97 rows=87 width=115) (actual time=0.792..75.922 rows=18 loops=1)

  • Join Filter: ((bpc.value)::text = (b.bpclass)::text)
  • Rows Removed by Join Filter: 180
59. 0.033 75.427 ↑ 4.8 18 1

Nested Loop Left Join (cost=0.29..8,929.38 rows=87 width=118) (actual time=0.325..75.427 rows=18 loops=1)

60. 75.304 75.304 ↑ 4.8 18 1

Seq Scan on c_order o (cost=0.00..8,349.54 rows=87 width=84) (actual time=0.290..75.304 rows=18 loops=1)

  • Filter: ((dateordered >= '2010-01-01'::date) AND (c_doctypetarget_id = '1000154'::numeric) AND (issotrx = 'Y'::bpchar) AND (c_division_id = '1000025'::numeric) AND (docstatus <> ALL ('{VO,RE,--}'::bpchar[])))
  • Rows Removed by Filter: 83264
61. 0.090 0.090 ↑ 1.0 1 18

Index Scan using c_bpartner_pkey on c_bpartner b (cost=0.29..6.65 rows=1 width=69) (actual time=0.004..0.005 rows=1 loops=18)

  • Index Cond: (c_bpartner_id = o.c_bpartner_id)
  • Filter: ((iscustomer = 'Y'::bpchar) OR (isprospect = 'Y'::bpchar))
62. 0.004 0.468 ↑ 1.0 10 18

Materialize (cost=22.93..67.57 rows=10 width=2) (actual time=0.023..0.026 rows=10 loops=18)

63. 0.195 0.464 ↑ 1.0 10 1

Hash Right Join (cost=22.93..67.52 rows=10 width=2) (actual time=0.407..0.464 rows=10 loops=1)

  • Hash Cond: (bpct.ad_ref_list_id = bpc.ad_ref_list_id)
64. 0.223 0.223 ↓ 1.0 1,492 1

Seq Scan on ad_ref_list_trl bpct (cost=0.00..38.90 rows=1,490 width=5) (actual time=0.017..0.223 rows=1,492 loops=1)

65. 0.005 0.046 ↑ 1.0 10 1

Hash (cost=22.80..22.80 rows=10 width=7) (actual time=0.046..0.046 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
66. 0.021 0.041 ↑ 1.0 10 1

Bitmap Heap Scan on ad_ref_list bpc (cost=4.36..22.80 rows=10 width=7) (actual time=0.031..0.041 rows=10 loops=1)

  • Recheck Cond: (ad_reference_id = '1000265'::numeric)
  • Heap Blocks: exact=2
67. 0.020 0.020 ↑ 1.0 10 1

Bitmap Index Scan on ad_ref_list_value (cost=0.00..4.35 rows=10 width=0) (actual time=0.020..0.020 rows=10 loops=1)

  • Index Cond: (ad_reference_id = '1000265'::numeric)
68. 0.024 0.378 ↑ 1.0 12 18

Materialize (cost=23.97..68.64 rows=12 width=41) (actual time=0.013..0.021 rows=12 loops=18)

69. 0.204 0.354 ↑ 1.0 12 1

Hash Right Join (cost=23.97..68.58 rows=12 width=41) (actual time=0.233..0.354 rows=12 loops=1)

  • Hash Cond: (rlt.ad_ref_list_id = rl.ad_ref_list_id)
70. 0.111 0.111 ↓ 1.0 1,492 1

Seq Scan on ad_ref_list_trl rlt (cost=0.00..38.90 rows=1,490 width=31) (actual time=0.003..0.111 rows=1,492 loops=1)

71. 0.003 0.039 ↑ 1.0 12 1

Hash (cost=23.82..23.82 rows=12 width=20) (actual time=0.039..0.039 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
72. 0.024 0.036 ↑ 1.0 12 1

Bitmap Heap Scan on ad_ref_list rl (cost=4.37..23.82 rows=12 width=20) (actual time=0.018..0.036 rows=12 loops=1)

  • Recheck Cond: (ad_reference_id = '131'::numeric)
  • Heap Blocks: exact=3
73. 0.012 0.012 ↑ 1.0 12 1

Bitmap Index Scan on ad_ref_list_value (cost=0.00..4.37 rows=12 width=0) (actual time=0.012..0.012 rows=12 loops=1)

  • Index Cond: (ad_reference_id = '131'::numeric)
74. 0.038 0.450 ↑ 1.0 26 18

Materialize (cost=2.14..202.43 rows=26 width=6) (actual time=0.005..0.025 rows=26 loops=18)

75. 0.022 0.412 ↑ 1.0 26 1

Nested Loop (cost=2.14..202.30 rows=26 width=6) (actual time=0.084..0.412 rows=26 loops=1)

76. 0.034 0.052 ↑ 1.0 26 1

HashAggregate (cost=1.85..2.11 rows=26 width=7) (actual time=0.048..0.052 rows=26 loops=1)

  • Group Key: c_division_bp.c_bpartner_id
77. 0.018 0.018 ↑ 1.0 68 1

Seq Scan on c_division_bp (cost=0.00..1.68 rows=68 width=7) (actual time=0.011..0.018 rows=68 loops=1)

78. 0.338 0.338 ↑ 1.0 1 26

Index Only Scan using c_bpartner_pkey on c_bpartner bp (cost=0.29..7.69 rows=1 width=6) (actual time=0.013..0.013 rows=1 loops=26)

  • Index Cond: (c_bpartner_id = c_division_bp.c_bpartner_id)
  • Heap Fetches: 26
79. 0.090 0.486 ↑ 1.0 1 18

Nested Loop Left Join (cost=1.26..8.73 rows=1 width=38) (actual time=0.025..0.027 rows=1 loops=18)

80. 0.018 0.360 ↑ 1.0 1 18

Nested Loop Left Join (cost=0.99..8.33 rows=1 width=47) (actual time=0.018..0.020 rows=1 loops=18)

81. 0.018 0.252 ↑ 1.0 1 18

Nested Loop Left Join (cost=0.70..7.50 rows=1 width=32) (actual time=0.013..0.014 rows=1 loops=18)

82. 0.000 0.162 ↑ 1.0 1 18

Nested Loop Left Join (cost=0.43..6.27 rows=1 width=28) (actual time=0.009..0.009 rows=1 loops=18)

83. 0.108 0.108 ↑ 1.0 1 18

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl (cost=0.29..6.10 rows=1 width=19) (actual time=0.005..0.006 rows=1 loops=18)

  • Index Cond: (c_bpartner_location_id = o.c_bpartner_location_ship_id)
  • Filter: (ad_client_id = '1000000'::numeric)
84. 0.054 0.054 ↑ 1.0 1 18

Index Scan using c_salesregion_pkey on c_salesregion sar (cost=0.14..0.16 rows=1 width=32) (actual time=0.002..0.003 rows=1 loops=18)

  • Index Cond: (c_salesregion_id = bpl.c_salesregion_id)
85. 0.072 0.072 ↑ 1.0 1 18

Index Scan using c_region_pkey on c_region sreg (cost=0.27..1.22 rows=1 width=20) (actual time=0.004..0.004 rows=1 loops=18)

  • Index Cond: (c_region_id = sar.c_region_id)
86. 0.090 0.090 ↑ 1.0 1 18

Index Scan using c_location_pkey on c_location loc (cost=0.29..0.82 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=18)

  • Index Cond: (c_location_id = bpl.c_location_id)
87. 0.036 0.036 ↑ 1.0 1 18

Index Scan using c_region_pkey on c_region reg (cost=0.27..0.29 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=18)

  • Index Cond: (c_region_id = loc.c_region_id)
88. 0.036 0.036 ↑ 1.0 1 18

Index Scan using m_pricelist_pkey on m_pricelist pl (cost=0.14..0.29 rows=1 width=48) (actual time=0.002..0.002 rows=1 loops=18)

  • Index Cond: (m_pricelist_id = o.m_pricelist_id)
89. 0.072 0.072 ↑ 1.0 1 18

Index Scan using ad_user_pkey on ad_user u (cost=0.29..5.50 rows=1 width=12) (actual time=0.003..0.004 rows=1 loops=18)

  • Index Cond: (ad_user_id = o.salesrep_id)
90. 0.054 0.054 ↑ 1.0 1 18

Index Scan using c_bpartner_pkey on c_bpartner bpu (cost=0.29..0.74 rows=1 width=50) (actual time=0.003..0.003 rows=1 loops=18)

  • Index Cond: (c_bpartner_id = u.c_bpartner_id)
91. 0.054 0.054 ↑ 1.0 1 18

Index Scan using c_bpartner_pkey on c_bpartner bc (cost=0.29..6.65 rows=1 width=50) (actual time=0.003..0.003 rows=1 loops=18)

  • Index Cond: (c_bpartner_id = o.c_bpartner_company_id)
92. 0.054 0.054 ↑ 1.0 1 18

Index Scan using c_currency_pkey on c_currency cur (cost=0.14..0.39 rows=1 width=9) (actual time=0.002..0.003 rows=1 loops=18)

  • Index Cond: (c_currency_id = o.c_currency_id)
93. 0.090 0.090 ↑ 9.0 1 18

Index Scan using c_orderline_order on c_orderline ol (cost=0.42..22.76 rows=9 width=21) (actual time=0.005..0.005 rows=1 loops=18)

  • Index Cond: (c_order_id = o.c_order_id)
94. 0.126 0.126 ↑ 1.0 1 18

Index Scan using m_product_pkey on m_product pol (cost=0.29..0.32 rows=1 width=65) (actual time=0.007..0.007 rows=1 loops=18)

  • Index Cond: (m_product_id = ol.m_product_id)
95. 0.014 431.122 ↑ 294.1 18 1

Merge Left Join (cost=13,989.14..15,024.42 rows=5,294 width=633) (actual time=431.115..431.122 rows=18 loops=1)

  • Merge Cond: (i.c_currency_id = cor_1.c_currency_id_to)
  • Join Filter: ((cor_1.validfrom <= o_1.dateordered) AND (cor_1.validto >= o_1.dateordered))
96. 0.015 431.108 ↑ 32.6 18 1

Sort (cost=12,612.31..12,613.78 rows=586 width=290) (actual time=431.107..431.108 rows=18 loops=1)

  • Sort Key: i.c_currency_id
  • Sort Method: quicksort Memory: 26kB
97. 0.011 431.093 ↑ 32.6 18 1

Hash Left Join (cost=11,626.39..12,585.37 rows=586 width=290) (actual time=431.077..431.093 rows=18 loops=1)

  • Hash Cond: (i.c_currency_id = cur_1.c_currency_id)
98. 11.520 430.966 ↑ 32.6 18 1

Hash Right Join (cost=11,619.46..12,570.38 rows=586 width=286) (actual time=430.950..430.966 rows=18 loops=1)

  • Hash Cond: (wi.c_invoice_id = i.c_invoice_id)
99. 343.683 343.683 ↓ 2.4 96,132 1

CTE Scan on w_invoice wi (cost=0.00..800.00 rows=40,000 width=80) (actual time=170.680..343.683 rows=96,132 loops=1)

100. 0.022 75.763 ↑ 32.6 18 1

Hash (cost=11,612.13..11,612.13 rows=586 width=228) (actual time=75.763..75.763 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
101. 0.008 75.741 ↑ 32.6 18 1

Nested Loop Left Join (cost=26.65..11,612.13 rows=586 width=228) (actual time=0.572..75.741 rows=18 loops=1)

102. 0.009 75.733 ↑ 32.6 18 1

Nested Loop Left Join (cost=26.37..11,414.64 rows=586 width=191) (actual time=0.570..75.733 rows=18 loops=1)

103. 0.013 75.706 ↑ 32.6 18 1

Nested Loop Left Join (cost=25.10..9,680.81 rows=586 width=165) (actual time=0.564..75.706 rows=18 loops=1)

  • Join Filter: ((rl_1.value)::bpchar = i.docstatus)
  • Rows Removed by Join Filter: 216
104. 0.015 75.351 ↑ 32.6 18 1

Nested Loop Left Join (cost=1.13..9,506.72 rows=586 width=129) (actual time=0.238..75.351 rows=18 loops=1)

105. 75.264 75.264 ↑ 4.8 18 1

Seq Scan on c_order o_1 (cost=0.00..8,349.54 rows=87 width=29) (actual time=0.212..75.264 rows=18 loops=1)

  • Filter: ((dateordered >= '2010-01-01'::date) AND (issotrx = 'Y'::bpchar) AND (c_doctypetarget_id = '1000154'::numeric) AND (c_division_id = '1000025'::numeric) AND (docstatus <> ALL ('{VO,RE,--}'::bpchar[])))
  • Rows Removed by Filter: 83264
106. 0.000 0.072 ↓ 0.0 0 18

Nested Loop Left Join (cost=1.13..13.25 rows=5 width=118) (actual time=0.004..0.004 rows=0 loops=18)

107. 0.000 0.072 ↓ 0.0 0 18

Nested Loop Left Join (cost=0.84..11.65 rows=5 width=66) (actual time=0.004..0.004 rows=0 loops=18)

108. 0.072 0.072 ↓ 0.0 0 18

Index Scan using c_invoice_order on c_invoice i (cost=0.42..9.56 rows=2 width=49) (actual time=0.004..0.004 rows=0 loops=18)

  • Index Cond: (o_1.c_order_id = c_order_id)
  • Filter: (docstatus <> ALL ('{VO,RE,--}'::bpchar[]))
109. 0.000 0.000 ↓ 0.0 0

Index Scan using c_invoiceline_invoice on c_invoiceline il (cost=0.42..0.99 rows=5 width=23) (never executed)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
110. 0.000 0.000 ↓ 0.0 0

Index Scan using m_product_pkey on m_product pol_1 (cost=0.29..0.31 rows=1 width=65) (never executed)

  • Index Cond: (m_product_id = il.m_product_id)
111. 0.021 0.342 ↑ 1.0 12 18

Materialize (cost=23.97..68.64 rows=12 width=41) (actual time=0.011..0.019 rows=12 loops=18)

112. 0.182 0.321 ↑ 1.0 12 1

Hash Right Join (cost=23.97..68.58 rows=12 width=41) (actual time=0.193..0.321 rows=12 loops=1)

  • Hash Cond: (rlt_1.ad_ref_list_id = rl_1.ad_ref_list_id)
113. 0.109 0.109 ↓ 1.0 1,492 1

Seq Scan on ad_ref_list_trl rlt_1 (cost=0.00..38.90 rows=1,490 width=31) (actual time=0.006..0.109 rows=1,492 loops=1)

114. 0.001 0.030 ↑ 1.0 12 1

Hash (cost=23.82..23.82 rows=12 width=20) (actual time=0.030..0.030 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
115. 0.012 0.029 ↑ 1.0 12 1

Bitmap Heap Scan on ad_ref_list rl_1 (cost=4.37..23.82 rows=12 width=20) (actual time=0.021..0.029 rows=12 loops=1)

  • Recheck Cond: (ad_reference_id = '131'::numeric)
  • Heap Blocks: exact=3
116. 0.017 0.017 ↑ 1.0 12 1

Bitmap Index Scan on ad_ref_list_value (cost=0.00..4.37 rows=12 width=0) (actual time=0.017..0.017 rows=12 loops=1)

  • Index Cond: (ad_reference_id = '131'::numeric)
117. 0.000 0.018 ↓ 0.0 0 18

Nested Loop Left Join (cost=1.26..2.95 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=18)

118. 0.000 0.018 ↓ 0.0 0 18

Nested Loop Left Join (cost=0.99..2.55 rows=1 width=47) (actual time=0.001..0.001 rows=0 loops=18)

119. 0.018 0.018 ↓ 0.0 0 18

Nested Loop Left Join (cost=0.70..1.71 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=18)

120. 0.000 0.000 ↓ 0.0 0 18

Nested Loop Left Join (cost=0.43..0.48 rows=1 width=28) (actual time=0.000..0.000 rows=0 loops=18)

121. 0.000 0.000 ↓ 0.0 0 18

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl_1 (cost=0.29..0.31 rows=1 width=19) (actual time=0.000..0.000 rows=0 loops=18)

  • Index Cond: (c_bpartner_location_id = i.c_bpartner_location_id)
  • Filter: (ad_client_id = '1000000'::numeric)
122. 0.000 0.000 ↓ 0.0 0

Index Scan using c_salesregion_pkey on c_salesregion sar_1 (cost=0.14..0.16 rows=1 width=32) (never executed)

  • Index Cond: (c_salesregion_id = bpl_1.c_salesregion_id)
123. 0.000 0.000 ↓ 0.0 0

Index Scan using c_region_pkey on c_region sreg_1 (cost=0.27..1.22 rows=1 width=20) (never executed)

  • Index Cond: (c_region_id = sar_1.c_region_id)
124. 0.000 0.000 ↓ 0.0 0

Index Scan using c_location_pkey on c_location loc_1 (cost=0.29..0.82 rows=1 width=32) (never executed)

  • Index Cond: (c_location_id = bpl_1.c_location_id)
125. 0.000 0.000 ↓ 0.0 0

Index Scan using c_region_pkey on c_region reg_1 (cost=0.27..0.29 rows=1 width=20) (never executed)

  • Index Cond: (c_region_id = loc_1.c_region_id)
126. 0.000 0.000 ↓ 0.0 0 18

Index Scan using c_bpartner_pkey on c_bpartner bc_1 (cost=0.29..0.33 rows=1 width=50) (actual time=0.000..0.000 rows=0 loops=18)

  • Index Cond: (c_bpartner_id = i.c_bpartner_company_id)
127. 0.050 0.116 ↑ 1.0 175 1

Hash (cost=4.75..4.75 rows=175 width=9) (actual time=0.116..0.116 rows=175 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
128. 0.066 0.066 ↑ 1.0 175 1

Seq Scan on c_currency cur_1 (cost=0.00..4.75 rows=175 width=9) (actual time=0.021..0.066 rows=175 loops=1)

129. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,376.82..1,410.74 rows=13,565 width=28) (never executed)

  • Sort Key: cor_1.c_currency_id_to
130. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_conversion_rate cor_1 (cost=0.00..445.75 rows=13,565 width=28) (never executed)

  • Filter: (c_currency_id = '341'::numeric)
131. 0.005 115.495 ↓ 0.0 0 1

Hash Right Join (cost=16,239.60..17,190.88 rows=77 width=632) (actual time=115.495..115.495 rows=0 loops=1)

  • Hash Cond: (wi_1.c_invoice_id = i_1.c_invoice_id)
132. 0.000 0.000 ↓ 0.0 0

CTE Scan on w_invoice wi_1 (cost=0.00..800.00 rows=40,000 width=80) (never executed)

133. 0.001 115.490 ↓ 0.0 0 1

Hash (cost=16,238.64..16,238.64 rows=77 width=234) (actual time=115.490..115.490 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
134. 0.000 115.489 ↓ 0.0 0 1

Hash Left Join (cost=8,749.89..16,238.64 rows=77 width=234) (actual time=115.489..115.489 rows=0 loops=1)

  • Hash Cond: (i_1.c_currency_id = cur_2.c_currency_id)
135. 0.000 115.489 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,742.95..16,230.65 rows=77 width=235) (actual time=115.489..115.489 rows=0 loops=1)

  • Join Filter: (il_1.c_invoice_id = i_1.c_invoice_id)
136. 0.002 115.489 ↓ 0.0 0 1

Hash Left Join (cost=8,742.52..16,163.92 rows=77 width=241) (actual time=115.489..115.489 rows=0 loops=1)

  • Hash Cond: (i_1.docstatus = (rl_2.value)::bpchar)
137. 0.000 115.487 ↓ 0.0 0 1

Nested Loop (cost=8,673.80..16,093.79 rows=77 width=205) (actual time=115.487..115.487 rows=0 loops=1)

138. 0.000 115.487 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,673.38..15,938.20 rows=29 width=181) (actual time=115.487..115.487 rows=0 loops=1)

  • Join Filter: ((corb.validfrom <= o_2.dateordered) AND (corb.validto >= o_2.dateordered))
139. 0.000 115.487 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,673.09..15,415.93 rows=3 width=187) (actual time=115.487..115.487 rows=0 loops=1)

140. 0.002 115.487 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,671.83..15,405.98 rows=3 width=161) (actual time=115.487..115.487 rows=0 loops=1)

141. 0.000 115.485 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,671.54..15,405.00 rows=3 width=108) (actual time=115.485..115.485 rows=0 loops=1)

142. 0.000 115.485 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,671.12..15,396.04 rows=1 width=87) (actual time=115.485..115.485 rows=0 loops=1)

143. 1.896 115.485 ↓ 0.0 0 1

Hash Join (cost=8,670.83..15,394.58 rows=1 width=49) (actual time=115.485..115.485 rows=0 loops=1)

  • Hash Cond: (obuy.c_order2_id = o_2.c_order_id)
144. 36.435 38.724 ↓ 4.2 18,219 1

Bitmap Heap Scan on c_order obuy (cost=320.20..7,027.50 rows=4,384 width=39) (actual time=2.917..38.724 rows=18,219 loops=1)

  • Recheck Cond: (c_doctypetarget_id = ANY ('{1000160,1000016}'::numeric[]))
  • Filter: ((issotrx = 'N'::bpchar) AND (docstatus <> ALL ('{VO,RE,--}'::bpchar[])))
  • Rows Removed by Filter: 435
  • Heap Blocks: exact=4474
145. 2.289 2.289 ↓ 1.0 18,665 1

Bitmap Index Scan on c_order_c_doctypetarget_id (cost=0.00..319.10 rows=17,936 width=0) (actual time=2.289..2.289 rows=18,665 loops=1)

  • Index Cond: (c_doctypetarget_id = ANY ('{1000160,1000016}'::numeric[]))
146. 0.004 74.865 ↑ 4.8 18 1

Hash (cost=8,349.54..8,349.54 rows=87 width=23) (actual time=74.865..74.865 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
147. 74.861 74.861 ↑ 4.8 18 1

Seq Scan on c_order o_2 (cost=0.00..8,349.54 rows=87 width=23) (actual time=0.219..74.861 rows=18 loops=1)

  • Filter: ((dateordered >= '2010-01-01'::date) AND (issotrx = 'Y'::bpchar) AND (c_doctypetarget_id = '1000154'::numeric) AND (c_division_id = '1000025'::numeric) AND (docstatus <> ALL ('{VO,RE,--}'::bpchar[])))
  • Rows Removed by Filter: 83264
148. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bc_2 (cost=0.29..1.45 rows=1 width=50) (never executed)

  • Index Cond: (c_bpartner_id = obuy.c_bpartner_id)
149. 0.000 0.000 ↓ 0.0 0

Index Scan using c_orderline_order on c_orderline olbuy (cost=0.42..8.88 rows=9 width=41) (never executed)

  • Index Cond: (c_order_id = obuy.c_order_id)
150. 0.000 0.000 ↓ 0.0 0

Index Scan using m_product_pkey on m_product pol_2 (cost=0.29..0.32 rows=1 width=65) (never executed)

  • Index Cond: (m_product_id = olbuy.m_product_id)
151. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.26..3.31 rows=1 width=38) (never executed)

152. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.99..2.90 rows=1 width=47) (never executed)

153. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.70..2.07 rows=1 width=32) (never executed)

154. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.43..0.84 rows=1 width=28) (never executed)

155. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl_2 (cost=0.29..0.67 rows=1 width=19) (never executed)

  • Index Cond: (c_bpartner_location_id = obuy.c_bpartner_location_id)
  • Filter: (ad_client_id = '1000000'::numeric)
156. 0.000 0.000 ↓ 0.0 0

Index Scan using c_salesregion_pkey on c_salesregion sar_2 (cost=0.14..0.16 rows=1 width=32) (never executed)

  • Index Cond: (c_salesregion_id = bpl_2.c_salesregion_id)
157. 0.000 0.000 ↓ 0.0 0

Index Scan using c_region_pkey on c_region sreg_2 (cost=0.27..1.22 rows=1 width=20) (never executed)

  • Index Cond: (c_region_id = sar_2.c_region_id)
158. 0.000 0.000 ↓ 0.0 0

Index Scan using c_location_pkey on c_location loc_2 (cost=0.29..0.82 rows=1 width=32) (never executed)

  • Index Cond: (c_location_id = bpl_2.c_location_id)
159. 0.000 0.000 ↓ 0.0 0

Index Scan using c_region_pkey on c_region reg_2 (cost=0.27..0.29 rows=1 width=20) (never executed)

  • Index Cond: (c_region_id = loc_2.c_region_id)
160. 0.000 0.000 ↓ 0.0 0

Index Scan using c_conversionrate_once on c_conversion_rate corb (cost=0.29..151.48 rows=1,507 width=28) (never executed)

  • Index Cond: ((c_currency_id = '341'::numeric) AND (c_currency_id_to = obuy.c_currency_id))
161. 0.000 0.000 ↓ 0.0 0

Index Scan using c_invoice_order on c_invoice i_1 (cost=0.42..5.35 rows=2 width=36) (never executed)

  • Index Cond: (c_order_id = obuy.c_order_id)
  • Filter: (docstatus <> ALL ('{VO,RE,--}'::bpchar[]))
162. 0.000 0.000 ↓ 0.0 0

Hash (cost=68.58..68.58 rows=12 width=41) (never executed)

163. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=23.97..68.58 rows=12 width=41) (never executed)

  • Hash Cond: (rlt_2.ad_ref_list_id = rl_2.ad_ref_list_id)
164. 0.000 0.000 ↓ 0.0 0

Seq Scan on ad_ref_list_trl rlt_2 (cost=0.00..38.90 rows=1,490 width=31) (never executed)

165. 0.000 0.000 ↓ 0.0 0

Hash (cost=23.82..23.82 rows=12 width=20) (never executed)

166. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on ad_ref_list rl_2 (cost=4.37..23.82 rows=12 width=20) (never executed)

  • Recheck Cond: (ad_reference_id = '131'::numeric)
167. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ad_ref_list_value (cost=0.00..4.37 rows=12 width=0) (never executed)

  • Index Cond: (ad_reference_id = '131'::numeric)
168. 0.000 0.000 ↓ 0.0 0

Index Scan using c_invoiceline_orderline on c_invoiceline il_1 (cost=0.42..0.84 rows=2 width=13) (never executed)

  • Index Cond: (c_orderline_id = olbuy.c_orderline_id)
169. 0.000 0.000 ↓ 0.0 0

Hash (cost=4.75..4.75 rows=175 width=9) (never executed)

170. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_currency cur_2 (cost=0.00..4.75 rows=175 width=9) (never executed)

171. 0.010 172.081 ↓ 0.0 0 1

Hash Right Join (cost=26,160.80..27,111.29 rows=29 width=632) (actual time=172.081..172.081 rows=0 loops=1)

  • Hash Cond: (wi_2.c_invoice_id = i_2.c_invoice_id)
172. 0.000 0.000 ↓ 0.0 0

CTE Scan on w_invoice wi_2 (cost=0.00..800.00 rows=40,000 width=80) (never executed)

173. 0.001 172.071 ↓ 0.0 0 1

Hash (cost=26,160.44..26,160.44 rows=29 width=234) (actual time=172.071..172.071 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
174. 0.000 172.070 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,423.18..26,160.44 rows=29 width=234) (actual time=172.070..172.070 rows=0 loops=1)

  • Join Filter: (il_2.c_invoice_id = i_2.c_invoice_id)
175. 0.001 172.070 ↓ 0.0 0 1

Hash Left Join (cost=8,422.76..26,135.31 rows=29 width=240) (actual time=172.070..172.070 rows=0 loops=1)

  • Hash Cond: (i_2.docstatus = (rl_3.value)::bpchar)
176. 0.000 172.069 ↓ 0.0 0 1

Nested Loop (cost=8,354.03..26,066.06 rows=29 width=204) (actual time=172.069..172.069 rows=0 loops=1)

177. 0.001 172.069 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,353.61..26,059.41 rows=10 width=191) (actual time=172.069..172.069 rows=0 loops=1)

  • Join Filter: ((corb_1.validfrom <= o_3.dateordered) AND (corb_1.validto >= o_3.dateordered))
178. 0.001 172.068 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,353.33..25,885.32 rows=1 width=197) (actual time=172.068..172.068 rows=0 loops=1)

179. 0.000 172.067 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,353.18..25,885.14 rows=1 width=193) (actual time=172.067..172.067 rows=0 loops=1)

180. 0.001 172.067 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,351.92..25,881.82 rows=1 width=167) (actual time=172.067..172.067 rows=0 loops=1)

181. 0.000 172.066 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,351.63..25,880.37 rows=1 width=129) (actual time=172.066..172.066 rows=0 loops=1)

182. 0.002 172.067 ↓ 0.0 0 1

Nested Loop (cost=8,351.34..25,880.04 rows=1 width=76) (actual time=172.066..172.067 rows=0 loops=1)

  • Join Filter: (o_3.c_order_id = ol_1.c_order_id)
183. 0.001 172.065 ↓ 0.0 0 1

Nested Loop (cost=8,350.92..25,878.07 rows=3 width=96) (actual time=172.065..172.065 rows=0 loops=1)

184. 37.774 172.064 ↓ 0.0 0 1

Hash Join (cost=8,350.63..25,854.92 rows=55 width=64) (actual time=172.064..172.064 rows=0 loops=1)

  • Hash Cond: (olbuy_1.link_order_id = o_3.c_order_id)
185. 74.010 74.010 ↑ 1.0 286,493 1

Seq Scan on c_orderline olbuy_1 (cost=0.00..16,429.27 rows=286,527 width=41) (actual time=0.011..74.010 rows=286,493 loops=1)

186. 0.010 60.280 ↑ 4.8 18 1

Hash (cost=8,349.54..8,349.54 rows=87 width=23) (actual time=60.280..60.280 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
187. 60.270 60.270 ↑ 4.8 18 1

Seq Scan on c_order o_3 (cost=0.00..8,349.54 rows=87 width=23) (actual time=0.186..60.270 rows=18 loops=1)

  • Filter: ((dateordered >= '2010-01-01'::date) AND (issotrx = 'Y'::bpchar) AND (c_doctypetarget_id = '1000154'::numeric) AND (c_division_id = '1000025'::numeric) AND (docstatus <> ALL ('{VO,RE,--}'::bpchar[])))
  • Rows Removed by Filter: 83264
188. 0.000 0.000 ↓ 0.0 0

Index Scan using c_order_pkey on c_order obuy_1 (cost=0.29..0.41 rows=1 width=32) (never executed)

  • Index Cond: (c_order_id = olbuy_1.c_order_id)
  • Filter: ((c_doctypetarget_id = ANY ('{1000160,1000016}'::numeric[])) AND (issotrx = 'N'::bpchar) AND (docstatus <> ALL ('{VO,RE,--}'::bpchar[])))
189. 0.000 0.000 ↓ 0.0 0

Index Scan using c_orderline_pkey on c_orderline ol_1 (cost=0.42..0.64 rows=1 width=12) (never executed)

  • Index Cond: (c_orderline_id = olbuy_1.link_orderline_id)
  • Filter: (olbuy_1.link_order_id = c_order_id)
190. 0.000 0.000 ↓ 0.0 0

Index Scan using m_product_pkey on m_product pol_3 (cost=0.29..0.32 rows=1 width=65) (never executed)

  • Index Cond: (m_product_id = olbuy_1.m_product_id)
191. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bc_3 (cost=0.29..1.45 rows=1 width=50) (never executed)

  • Index Cond: (c_bpartner_id = obuy_1.c_bpartner_id)
192. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.26..3.31 rows=1 width=38) (never executed)

193. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.99..2.90 rows=1 width=47) (never executed)

194. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.70..2.07 rows=1 width=32) (never executed)

195. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.43..0.84 rows=1 width=28) (never executed)

196. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl_3 (cost=0.29..0.67 rows=1 width=19) (never executed)

  • Index Cond: (c_bpartner_location_id = obuy_1.c_bpartner_location_id)
  • Filter: (ad_client_id = '1000000'::numeric)
197. 0.000 0.000 ↓ 0.0 0

Index Scan using c_salesregion_pkey on c_salesregion sar_3 (cost=0.14..0.16 rows=1 width=32) (never executed)

  • Index Cond: (c_salesregion_id = bpl_3.c_salesregion_id)
198. 0.000 0.000 ↓ 0.0 0

Index Scan using c_region_pkey on c_region sreg_3 (cost=0.27..1.22 rows=1 width=20) (never executed)

  • Index Cond: (c_region_id = sar_3.c_region_id)
199. 0.000 0.000 ↓ 0.0 0

Index Scan using c_location_pkey on c_location loc_3 (cost=0.29..0.82 rows=1 width=32) (never executed)

  • Index Cond: (c_location_id = bpl_3.c_location_id)
200. 0.000 0.000 ↓ 0.0 0

Index Scan using c_region_pkey on c_region reg_3 (cost=0.27..0.29 rows=1 width=20) (never executed)

  • Index Cond: (c_region_id = loc_3.c_region_id)
201. 0.000 0.000 ↓ 0.0 0

Index Scan using c_currency_pkey on c_currency cur_3 (cost=0.14..0.17 rows=1 width=9) (never executed)

  • Index Cond: (c_currency_id = obuy_1.c_currency_id)
202. 0.000 0.000 ↓ 0.0 0

Index Scan using c_conversionrate_once on c_conversion_rate corb_1 (cost=0.29..151.48 rows=1,507 width=28) (never executed)

  • Index Cond: ((c_currency_id = '341'::numeric) AND (c_currency_id_to = obuy_1.c_currency_id))
203. 0.000 0.000 ↓ 0.0 0

Index Scan using c_invoice_order on c_invoice i_2 (cost=0.42..0.65 rows=2 width=31) (never executed)

  • Index Cond: (c_order_id = olbuy_1.c_order_id)
  • Filter: (docstatus <> ALL ('{VO,RE,--}'::bpchar[]))
204. 0.000 0.000 ↓ 0.0 0

Hash (cost=68.58..68.58 rows=12 width=41) (never executed)

205. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=23.97..68.58 rows=12 width=41) (never executed)

  • Hash Cond: (rlt_3.ad_ref_list_id = rl_3.ad_ref_list_id)
206. 0.000 0.000 ↓ 0.0 0

Seq Scan on ad_ref_list_trl rlt_3 (cost=0.00..38.90 rows=1,490 width=31) (never executed)

207. 0.000 0.000 ↓ 0.0 0

Hash (cost=23.82..23.82 rows=12 width=20) (never executed)

208. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on ad_ref_list rl_3 (cost=4.37..23.82 rows=12 width=20) (never executed)

  • Recheck Cond: (ad_reference_id = '131'::numeric)
209. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ad_ref_list_value (cost=0.00..4.37 rows=12 width=0) (never executed)

  • Index Cond: (ad_reference_id = '131'::numeric)
210. 0.000 0.000 ↓ 0.0 0

Index Scan using c_invoiceline_orderline on c_invoiceline il_2 (cost=0.42..0.84 rows=2 width=13) (never executed)

  • Index Cond: (c_orderline_id = olbuy_1.c_orderline_id)
211. 0.001 54,786.889 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5 (cost=3,642.50..4,772.30 rows=9 width=656) (actual time=54,786.889..54,786.889 rows=0 loops=1)

212. 0.001 54,786.888 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,642.50..4,772.21 rows=9 width=656) (actual time=54,786.888..54,786.888 rows=0 loops=1)

  • Join Filter: ((corb_2.validfrom <= o_4.dateordered) AND (corb_2.validto >= o_4.dateordered))
213. 0.000 54,786.887 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,642.22..4,596.24 rows=1 width=294) (actual time=54,786.887..54,786.887 rows=0 loops=1)

214. 0.001 54,786.887 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,642.07..4,596.04 rows=1 width=290) (actual time=54,786.887..54,786.887 rows=0 loops=1)

215. 0.041 54,786.886 ↓ 0.0 0 1

Hash Right Join (cost=3,640.81..4,590.82 rows=1 width=264) (actual time=54,786.886..54,786.886 rows=0 loops=1)

  • Hash Cond: (wi_3.c_invoice_id = i_3.c_invoice_id)
216. 0.000 0.000 ↓ 0.0 0

CTE Scan on w_invoice wi_3 (cost=0.00..800.00 rows=40,000 width=80) (never executed)

217. 0.002 54,786.845 ↓ 0.0 0 1

Hash (cost=3,640.79..3,640.79 rows=1 width=206) (actual time=54,786.845..54,786.845 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
218. 0.000 54,786.843 ↓ 0.0 0 1

Nested Loop Left Join (cost=88.60..3,640.79 rows=1 width=206) (actual time=54,786.843..54,786.843 rows=0 loops=1)

219. 0.001 54,786.843 ↓ 0.0 0 1

Nested Loop Left Join (cost=88.31..3,637.01 rows=1 width=168) (actual time=54,786.843..54,786.843 rows=0 loops=1)

220. 0.001 54,786.842 ↓ 0.0 0 1

Nested Loop (cost=88.02..3,636.69 rows=1 width=116) (actual time=54,786.842..54,786.842 rows=0 loops=1)

221. 0.000 54,786.841 ↓ 0.0 0 1

Nested Loop Left Join (cost=87.74..3,636.37 rows=1 width=126) (actual time=54,786.841..54,786.841 rows=0 loops=1)

222. 0.000 54,786.841 ↓ 0.0 0 1

Nested Loop Left Join (cost=87.46..3,630.40 rows=1 width=105) (actual time=54,786.841..54,786.841 rows=0 loops=1)

  • Join Filter: ((rl2.value)::bpchar = i_3.docstatus)
223. 0.002 54,786.841 ↓ 0.0 0 1

Nested Loop (cost=83.09..3,606.43 rows=1 width=90) (actual time=54,786.841..54,786.841 rows=0 loops=1)

  • Join Filter: ((sr.c_order_id = buy.c_order_id) OR (sr.c_order_id = o_4.c_order_id))
224. 19,320.336 54,786.839 ↓ 0.0 0 1

Nested Loop Left Join (cost=82.81..3,606.04 rows=1 width=124) (actual time=54,786.839..54,786.839 rows=0 loops=1)

  • Join Filter: (((o_4.c_order_id = buy.c_order2_id) OR (o_4.c_order_id = buy.link_order_id)) AND CASE WHEN (buy.link_order_id > '0'::numeric) THEN (ol_2.c_orderline_id = buy.link_orderline_id) ELSE true END)
  • Rows Removed by Join Filter: 143275881
  • Filter: ((srl.c_orderline_id = buy.c_orderline_id) OR (srl.c_orderline_id = buy.link_orderline_id) OR (srl.c_orderline_id = ol_2.c_orderline_id))
  • Rows Removed by Filter: 5593
225. 16.975 24,302.875 ↓ 5,593.0 5,593 1

Merge Join (cost=82.81..3,594.26 rows=1 width=120) (actual time=22.493..24,302.875 rows=5,593 loops=1)

  • Merge Cond: (il_3.aek_route_id = rl_4.aek_route_id)
  • Join Filter: ((srl.aek_shiprequest_id = rl_4.aek_shiprequest_id) AND (srl.aek_shiprequestline_id = rl_4.aek_shiprequestline_id))
  • Rows Removed by Join Filter: 9962
226. 3.167 24,269.145 ↓ 17.1 5,917 1

Nested Loop (cost=1.56..291,495.86 rows=347 width=120) (actual time=16.570..24,269.145 rows=5,917 loops=1)

227. 0.730 327.021 ↓ 349.0 349 1

Nested Loop (cost=1.14..281,155.62 rows=1 width=91) (actual time=16.395..327.021 rows=349 loops=1)

228. 126.837 319.127 ↑ 1.1 398 1

Nested Loop (cost=0.71..280,928.54 rows=419 width=55) (actual time=16.359..319.127 rows=398 loops=1)

229. 192.290 192.290 ↑ 1.4 458,558 1

Index Scan using art_c_invoiceline_route_id on c_invoiceline il_3 (cost=0.42..76,432.74 rows=628,560 width=37) (actual time=0.043..192.290 rows=458,558 loops=1)

230. 0.000 0.000 ↓ 0.0 0 458,558

Index Scan using aek_shiprequestline_pkey on aek_shiprequestline srl (cost=0.29..0.32 rows=1 width=18) (actual time=0.000..0.000 rows=0 loops=458,558)

  • Index Cond: (aek_shiprequestline_id = il_3.aek_shiprequestline_id)
231. 7.164 7.164 ↑ 1.0 1 398

Index Scan using c_invoice_key on c_invoice i_3 (cost=0.42..0.53 rows=1 width=42) (actual time=0.017..0.018 rows=1 loops=398)

  • Index Cond: (c_invoice_id = il_3.c_invoice_id)
  • Filter: ((c_doctypetarget_id = ANY ('{1000005,1000158}'::numeric[])) AND (issotrx = 'N'::bpchar) AND (iscargo = 'Y'::bpchar) AND (docstatus <> ALL ('{VO,RE,--}'::bpchar[])))
  • Rows Removed by Filter: 0
232. 8.112 23,938.957 ↑ 17.6 17 349

Nested Loop (cost=0.42..10,337.24 rows=299 width=29) (actual time=0.201..68.593 rows=17 loops=349)

233. 23,899.520 23,899.520 ↑ 4.8 18 349

Seq Scan on c_order o_4 (cost=0.00..8,349.54 rows=87 width=23) (actual time=0.193..68.480 rows=18 loops=349)

  • Filter: ((dateordered >= '2010-01-01'::date) AND (issotrx = 'Y'::bpchar) AND (c_doctypetarget_id = '1000154'::numeric) AND (c_division_id = '1000025'::numeric) AND (docstatus <> ALL ('{VO,RE,--}'::bpchar[])))
  • Rows Removed by Filter: 83026
234. 31.325 31.325 ↑ 9.0 1 6,265

Index Scan using c_orderline_order on c_orderline ol_2 (cost=0.42..22.76 rows=9 width=12) (actual time=0.005..0.005 rows=1 loops=6,265)

  • Index Cond: (c_order_id = o_4.c_order_id)
235. 16.755 16.755 ↓ 1.8 33,769 1

Index Scan using aek_routeline_route_id on aek_routeline rl_4 (cost=0.29..1,025.14 rows=18,938 width=19) (actual time=0.022..16.755 rows=33,769 loops=1)

236. 11,163.628 11,163.628 ↓ 103.3 25,617 5,593

CTE Scan on buy (cost=0.00..4.96 rows=248 width=80) (actual time=0.000..1.996 rows=25,617 loops=5,593)

237. 0.000 0.000 ↓ 0.0 0

Index Scan using aek_shiprequest_pkey on aek_shiprequest sr (cost=0.29..0.37 rows=1 width=13) (never executed)

  • Index Cond: (aek_shiprequest_id = srl.aek_shiprequest_id)
  • Filter: (shiprequesttype = 'C'::bpchar)
238. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on ad_ref_list rl2 (cost=4.37..23.82 rows=12 width=20) (never executed)

  • Recheck Cond: (ad_reference_id = '131'::numeric)
239. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ad_ref_list_value (cost=0.00..4.37 rows=12 width=0) (never executed)

  • Index Cond: (ad_reference_id = '131'::numeric)
240. 0.000 0.000 ↓ 0.0 0

Index Scan using ad_ref_list_trl_pkey on ad_ref_list_trl rlt2 (cost=0.28..5.96 rows=1 width=31) (never executed)

  • Index Cond: (ad_ref_list_id = rl2.ad_ref_list_id)
241. 0.000 0.000 ↓ 0.0 0

Index Scan using aek_route_pkey on aek_route r (cost=0.29..0.31 rows=1 width=11) (never executed)

  • Index Cond: (aek_route_id = il_3.aek_route_id)
  • Filter: ((docstatus)::text <> ALL ('{VO,RE,--}'::text[]))
242. 0.000 0.000 ↓ 0.0 0

Index Scan using m_product_pkey on m_product pol_4 (cost=0.29..0.31 rows=1 width=65) (never executed)

  • Index Cond: (m_product_id = il_3.m_product_id)
243. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bc_4 (cost=0.29..3.78 rows=1 width=50) (never executed)

  • Index Cond: (c_bpartner_id = i_3.c_bpartner_id)
244. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.26..5.22 rows=1 width=38) (never executed)

245. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.99..4.81 rows=1 width=47) (never executed)

246. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.70..3.98 rows=1 width=32) (never executed)

247. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.43..2.75 rows=1 width=28) (never executed)

248. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl_4 (cost=0.29..2.58 rows=1 width=19) (never executed)

  • Index Cond: (c_bpartner_location_id = i_3.c_bpartner_location_id)
  • Filter: (ad_client_id = '1000000'::numeric)
249. 0.000 0.000 ↓ 0.0 0

Index Scan using c_salesregion_pkey on c_salesregion sar_4 (cost=0.14..0.16 rows=1 width=32) (never executed)

  • Index Cond: (c_salesregion_id = bpl_4.c_salesregion_id)
250. 0.000 0.000 ↓ 0.0 0

Index Scan using c_region_pkey on c_region sreg_4 (cost=0.27..1.22 rows=1 width=20) (never executed)

  • Index Cond: (c_region_id = sar_4.c_region_id)
251. 0.000 0.000 ↓ 0.0 0

Index Scan using c_location_pkey on c_location loc_4 (cost=0.29..0.82 rows=1 width=32) (never executed)

  • Index Cond: (c_location_id = bpl_4.c_location_id)
252. 0.000 0.000 ↓ 0.0 0

Index Scan using c_region_pkey on c_region reg_4 (cost=0.27..0.29 rows=1 width=20) (never executed)

  • Index Cond: (c_region_id = loc_4.c_region_id)
253. 0.000 0.000 ↓ 0.0 0

Index Scan using c_currency_pkey on c_currency cur_4 (cost=0.14..0.19 rows=1 width=9) (never executed)

  • Index Cond: (c_currency_id = i_3.c_currency_id)
254. 0.000 0.000 ↓ 0.0 0

Index Scan using c_conversionrate_once on c_conversion_rate corb_2 (cost=0.29..153.20 rows=1,507 width=28) (never executed)

  • Index Cond: ((c_currency_id = '341'::numeric) AND (c_currency_id_to = i_3.c_currency_id))
255. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=673) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
256. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 7 (cost=0.00..0.00 rows=1 width=510) (actual time=0.001..0.001 rows=0 loops=1)

257. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=510) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
258. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=656) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
259. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=655) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: false