explain.depesz.com

PostgreSQL's explain analyze made readable

Result: P6Ad

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1,708,576,281.86..1,708,924,097.47 rows=443,078 width=820) (actual rows= loops=)

  • Group Key: q."File type", q."Point Id", q."From date", q."To date", q."Supplier Id", q."Delivery period From date", q."Delivery period To date", q."Index status", q."Reading frequency", q."Measurement period", q."Context", q."Meter number", q."Register name", q."Measurement nature", q."Timeframe", q."Direction", q."Value list", q."Quality list", q."Quality explanation list", q."Market transaction number", q."Market transaction timestamp", q."Source", q."Historical data", q."Release", q."Reading quality", q."ExternalRef", q."Index Ignored", q.relatedentitytype, q.deliveryperiodexternalid
2. 0.000 0.000 ↓ 0.0

Sort (cost=1,708,576,281.86..1,708,587,358.79 rows=4,430,772 width=820) (actual rows= loops=)

  • Sort Key: q."File type", q."Point Id", q."From date", q."To date", q."Supplier Id", q."Delivery period From date", q."Delivery period To date", q."Index status", q."Reading frequency", q."Measurement period", q."Context", q."Meter number", q."Register name", q."Measurement nature", q."Timeframe", q."Direction", q."Value list", q."Quality list", q."Quality explanation list", q."Market transaction number", q."Market transaction timestamp", q."Source", q."Historical data", q."Release", q."Reading quality", q."ExternalRef", q."Index Ignored", q.relatedentitytype, q.deliveryperiodexternalid
3. 0.000 0.000 ↓ 0.0

Subquery Scan on q (cost=3,411,096.62..1,707,169,833.97 rows=4,430,772 width=820) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Append (cost=3,411,096.62..1,707,125,526.25 rows=4,430,772 width=211) (actual rows= loops=)

5.          

CTE previousmet

6. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,118,566.38..1,118,791.28 rows=22,490 width=4) (actual rows= loops=)

  • Group Key: i_3.meteringid
7. 0.000 0.000 ↓ 0.0

Merge Anti Join (cost=1,049,144.49..1,118,510.15 rows=22,490 width=4) (actual rows= loops=)

  • Merge Cond: ((i_3.previousindexdate = index.indexdate) AND (j.pointid = contractdpjournal.pointid) AND (i_3.previousindex = index.index) AND ((i_3.timeframe)::text = (index.timeframe)::text) AND ((i_3.unit)::text = (index.unit)::text) AND ((i_3.type)::text = (index.type)::text))
8. 0.000 0.000 ↓ 0.0

Sort (cost=393,354.10..395,726.31 rows=948,885 width=27) (actual rows= loops=)

  • Sort Key: i_3.previousindexdate, j.pointid, i_3.previousindex, i_3.timeframe, i_3.unit, i_3.type
9. 0.000 0.000 ↓ 0.0

Hash Join (cost=23,228.85..286,175.39 rows=948,885 width=27) (actual rows= loops=)

  • Hash Cond: (m_2.contractdpid = j.contractdpid)
10. 0.000 0.000 ↓ 0.0

Merge Join (cost=5.56..242,788.29 rows=948,885 width=27) (actual rows= loops=)

  • Merge Cond: (i_3.meteringid = m_2.meteringid)
11. 0.000 0.000 ↓ 0.0

Index Scan using idx_index_meteringid on index i_3 (cost=0.43..125,105.91 rows=948,885 width=23) (actual rows= loops=)

  • Filter: (previousindexdate < indexdate)
12. 0.000 0.000 ↓ 0.0

Index Scan using idx_metering_contractdpid on metering m_2 (cost=0.43..98,473.00 rows=2,942,305 width=8) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash (cost=17,543.13..17,543.13 rows=454,413 width=8) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Seq Scan on contractdpjournal j (cost=0.00..17,543.13 rows=454,413 width=8) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Materialize (cost=655,786.73..668,987.15 rows=2,640,084 width=23) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Sort (cost=655,786.73..662,386.94 rows=2,640,084 width=23) (actual rows= loops=)

  • Sort Key: index.indexdate, contractdpjournal.pointid, index.index, index.timeframe, index.unit, index.type
17. 0.000 0.000 ↓ 0.0

Hash Join (cost=23,228.94..343,253.36 rows=2,640,084 width=23) (actual rows= loops=)

  • Hash Cond: (metering.contractdpid = contractdpjournal.contractdpid)
18. 0.000 0.000 ↓ 0.0

Merge Join (cost=5.65..263,928.28 rows=2,640,084 width=23) (actual rows= loops=)

  • Merge Cond: (index.meteringid = metering.meteringid)
19. 0.000 0.000 ↓ 0.0

Index Scan using idx_index_meteringid on index (cost=0.43..125,105.91 rows=2,640,084 width=23) (actual rows= loops=)

  • Filter: ((status)::text = 'A'::text)
20. 0.000 0.000 ↓ 0.0

Index Scan using idx_metering_contractdpid on metering (cost=0.43..98,473.00 rows=2,942,305 width=8) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=17,543.13..17,543.13 rows=454,413 width=8) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on contractdpjournal (cost=0.00..17,543.13 rows=454,413 width=8) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=2,292,305.34..1,644,333,991.53 rows=2,846,656 width=218) (actual rows= loops=)

  • Merge Cond: (i.meteringid = i2.meteringid)
  • Join Filter: ((i.meterid <> i2.meterid) AND (i.previousindexdate = i.indexdate) AND ((i.timeframe)::text = (i2.timeframe)::text) AND ((i.unit)::text = (i2.unit)::text) AND ((i.type)::text = (i2.type)::text))
24. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2,292,304.91..112,448,110.25 rows=2,846,656 width=222) (actual rows= loops=)

  • Join Filter: (dpc.dpconfigjid IS NULL)
25. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2,292,278.71..35,685,243.35 rows=2,846,656 width=224) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2,292,267.83..2,564,247.24 rows=2,846,656 width=218) (actual rows= loops=)

  • Join Filter: (contract.supplierid = s.supplierid)
27. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,292,267.83..2,478,846.54 rows=2,846,656 width=190) (actual rows= loops=)

  • Merge Cond: (i.meteringid = m.meteringid)
28. 0.000 0.000 ↓ 0.0

Index Scan using idx_index_meteringid on index i (cost=0.43..128,934.65 rows=2,846,656 width=69) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Materialize (cost=2,292,262.43..2,306,973.96 rows=2,942,305 width=125) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Sort (cost=2,292,262.43..2,299,618.20 rows=2,942,305 width=125) (actual rows= loops=)

  • Sort Key: m.meteringid
31. 0.000 0.000 ↓ 0.0

Hash Join (cost=657,922.66..1,866,945.60 rows=2,942,305 width=125) (actual rows= loops=)

  • Hash Cond: (cdp.pointid = dp.pointid)
32. 0.000 0.000 ↓ 0.0

Hash Join (cost=644,107.65..1,797,962.38 rows=2,942,305 width=97) (actual rows= loops=)

  • Hash Cond: (m.contractdpid = cdp.contractdpid)
33. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=574,651.66..1,665,982.40 rows=2,942,305 width=72) (actual rows= loops=)

  • Hash Cond: (t.envid = msg.envid)
34. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=426,302.32..1,382,450.82 rows=2,942,305 width=58) (actual rows= loops=)

  • Merge Cond: (t.msgid = m.txref)
35. 0.000 0.000 ↓ 0.0

Index Scan using idx_transaction_msgid_pk on transaction t (cost=0.44..858,105.15 rows=19,593,910 width=48) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Materialize (cost=426,301.88..441,013.41 rows=2,942,305 width=18) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Sort (cost=426,301.88..433,657.64 rows=2,942,305 width=18) (actual rows= loops=)

  • Sort Key: m.txref
38. 0.000 0.000 ↓ 0.0

Seq Scan on metering m (cost=0.00..75,691.05 rows=2,942,305 width=18) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Hash (cost=95,707.04..95,707.04 rows=2,867,304 width=22) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Seq Scan on msgenv msg (cost=0.00..95,707.04 rows=2,867,304 width=22) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Hash (cost=63,775.83..63,775.83 rows=454,413 width=29) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Hash Join (cost=36,576.43..63,775.83 rows=454,413 width=29) (actual rows= loops=)

  • Hash Cond: (cdp.contractid = contract.contractid)
43. 0.000 0.000 ↓ 0.0

Seq Scan on contractdpjournal cdp (cost=0.00..17,543.13 rows=454,413 width=25) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Hash (cost=30,957.30..30,957.30 rows=449,530 width=8) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Seq Scan on contract (cost=0.00..30,957.30 rows=449,530 width=8) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Hash (cost=9,436.67..9,436.67 rows=350,267 width=28) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Seq Scan on deliverypoint dp (cost=0.00..9,436.67 rows=350,267 width=28) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.03 rows=2 width=36) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Seq Scan on supplier s (cost=0.00..1.02 rows=2 width=36) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Index Scan using dpj_un on dpconfigjournal dpc (cost=10.87..11.63 rows=1 width=6) (actual rows= loops=)

  • Index Cond: (dpconfigjid = (SubPlan 8))
51.          

SubPlan (for Index Scan)

52. 0.000 0.000 ↓ 0.0

Limit (cost=10.44..10.45 rows=1 width=26) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Sort (cost=10.44..10.45 rows=1 width=26) (actual rows= loops=)

  • Sort Key: ((tx_2.msgdate)::date), ((j_3.creationdate)::date), j_3.fromdate, j_3.powerlimiter, m_5.budgetmeter
54. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.29..10.43 rows=1 width=26) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.86..7.98 rows=1 width=29) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_3 (cost=0.42..5.51 rows=1 width=25) (actual rows= loops=)

  • Index Cond: (pointid = dp.pointid)
  • Filter: ((fromdate <= i.indexdate) AND ((source)::text = 'DGO'::text))
57. 0.000 0.000 ↓ 0.0

Index Scan using idx_transaction_msgid_pk on transaction tx_2 (cost=0.44..2.46 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (msgid = j_3.txref)
58. 0.000 0.000 ↓ 0.0

Index Scan using idx_meter_physicalconfigid_pk on meter m_5 (cost=0.42..2.44 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (j_3.physicalconfigid = physicalconfigid)
59. 0.000 0.000 ↓ 0.0

Index Scan using dpj_un on dpconfigjournal dpc2 (cost=26.20..26.96 rows=1 width=6) (actual rows= loops=)

  • Index Cond: (dpconfigjid = (SubPlan 10))
60.          

SubPlan (for Index Scan)

61. 0.000 0.000 ↓ 0.0

Limit (cost=25.77..25.78 rows=1 width=26) (actual rows= loops=)

62.          

Initplan (for Limit)

63. 0.000 0.000 ↓ 0.0

Aggregate (cost=15.32..15.33 rows=1 width=4) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.85..15.31 rows=4 width=4) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j1_1 (cost=0.42..5.50 rows=4 width=12) (actual rows= loops=)

  • Index Cond: (pointid = dp.pointid)
  • Filter: ((source)::text = 'DGO'::text)
66. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_meter_physicalconfigid_pk on meter m1_1 (cost=0.42..2.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (physicalconfigid = j1_1.physicalconfigid)
67. 0.000 0.000 ↓ 0.0

Sort (cost=10.44..10.45 rows=1 width=26) (actual rows= loops=)

  • Sort Key: ((tx_3.msgdate)::date), ((j_4.creationdate)::date), j_4.powerlimiter, m_6.budgetmeter
68. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.29..10.43 rows=1 width=26) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.86..7.98 rows=1 width=29) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_4 (cost=0.42..5.51 rows=1 width=25) (actual rows= loops=)

  • Index Cond: (pointid = dp.pointid)
  • Filter: (((source)::text = 'DGO'::text) AND (fromdate = $31))
71. 0.000 0.000 ↓ 0.0

Index Scan using idx_transaction_msgid_pk on transaction tx_3 (cost=0.44..2.46 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (msgid = j_4.txref)
72. 0.000 0.000 ↓ 0.0

Index Scan using idx_meter_physicalconfigid_pk on meter m_6 (cost=0.42..2.44 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (j_4.physicalconfigid = physicalconfigid)
73. 0.000 0.000 ↓ 0.0

Materialize (cost=0.43..136,051.29 rows=2,846,656 width=17) (actual rows= loops=)

74. 0.000 0.000 ↓ 0.0

Index Scan using idx_index_meteringid on index i2 (cost=0.43..128,934.65 rows=2,846,656 width=17) (actual rows= loops=)

75.          

SubPlan (for Merge Left Join)

76. 0.000 0.000 ↓ 0.0

Nested Loop (cost=507.31..535.32 rows=1 width=0) (actual rows= loops=)

  • Join Filter: (i3.meteringid = previousmet_1.meteringid)
77. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.28..24.79 rows=1 width=8) (actual rows= loops=)

78. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..17.77 rows=13 width=4) (actual rows= loops=)

79. 0.000 0.000 ↓ 0.0

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal j3 (cost=0.42..3.45 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (pointid = cdp.pointid)
80. 0.000 0.000 ↓ 0.0

Index Scan using idx_metering_contractdpid_2 on metering m3 (cost=0.43..7.07 rows=9 width=8) (actual rows= loops=)

  • Index Cond: (contractdpid = j3.contractdpid)
81. 0.000 0.000 ↓ 0.0

Index Scan using idx_index_meteringid on index i3 (cost=0.43..0.53 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (meteringid = m3.meteringid)
  • Filter: ((previousindexdate = i.indexdate) AND ((status)::text = 'A'::text))
82. 0.000 0.000 ↓ 0.0

HashAggregate (cost=506.03..508.03 rows=200 width=4) (actual rows= loops=)

  • Group Key: previousmet_1.meteringid
83. 0.000 0.000 ↓ 0.0

CTE Scan on previousmet previousmet_1 (cost=0.00..449.80 rows=22,490 width=4) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..18.62 rows=12 width=0) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal cdp_4 (cost=0.42..3.45 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (pointid = dp.pointid)
86. 0.000 0.000 ↓ 0.0

Index Only Scan using process_idx4test on process p_1 (cost=0.43..7.50 rows=9 width=4) (actual rows= loops=)

  • Index Cond: (contractdpid = cdp_4.contractdpid)
87. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=2,350,518.70..61,539,969.98 rows=1,422,664 width=210) (actual rows= loops=)

88. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=2,350,518.70..61,525,743.34 rows=1,422,664 width=210) (actual rows= loops=)

  • Merge Cond: (i_1.meteringid = i2_1.meteringid)
  • Join Filter: ((i_1.meterid <> i2_1.meterid) AND (i_1.previousindexdate = i_1.indexdate) AND ((i_1.timeframe)::text = (i2_1.timeframe)::text) AND ((i_1.unit)::text = (i2_1.unit)::text) AND ((i_1.type)::text = (i2_1.type)::text))
89. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2,350,518.27..57,460,460.01 rows=1,422,664 width=218) (actual rows= loops=)

  • Join Filter: (dpc_1.dpconfigjid IS NULL)
90. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2,350,492.07..19,096,931.98 rows=1,422,664 width=220) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,350,481.20..2,544,159.60 rows=1,422,664 width=214) (actual rows= loops=)

  • Merge Cond: (m_1.meteringid = previousmet.meteringid)
92. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,349,965.53..2,536,527.68 rows=2,845,328 width=218) (actual rows= loops=)

  • Merge Cond: (i_1.meteringid = m_1.meteringid)
93. 0.000 0.000 ↓ 0.0

Index Scan using idx_index_meteringid on index i_1 (cost=0.43..128,934.65 rows=2,845,328 width=69) (actual rows= loops=)

  • Filter: ((previousindexdate IS NOT NULL) AND (previousindex IS NOT NULL))
94. 0.000 0.000 ↓ 0.0

Materialize (cost=2,349,960.17..2,364,671.70 rows=2,942,305 width=149) (actual rows= loops=)

95. 0.000 0.000 ↓ 0.0

Sort (cost=2,349,960.17..2,357,315.93 rows=2,942,305 width=149) (actual rows= loops=)

  • Sort Key: m_1.meteringid
96. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=657,923.70..1,907,403.34 rows=2,942,305 width=149) (actual rows= loops=)

  • Hash Cond: (contract_1.supplierid = s_1.supplierid)
97. 0.000 0.000 ↓ 0.0

Hash Join (cost=657,922.66..1,866,945.60 rows=2,942,305 width=121) (actual rows= loops=)

  • Hash Cond: (cdp_1.pointid = dp_1.pointid)
98. 0.000 0.000 ↓ 0.0

Hash Join (cost=644,107.65..1,797,962.38 rows=2,942,305 width=97) (actual rows= loops=)

  • Hash Cond: (m_1.contractdpid = cdp_1.contractdpid)
99. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=574,651.66..1,665,982.40 rows=2,942,305 width=72) (actual rows= loops=)

  • Hash Cond: (t_1.envid = msg_1.envid)
100. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=426,302.32..1,382,450.82 rows=2,942,305 width=58) (actual rows= loops=)

  • Merge Cond: (t_1.msgid = m_1.txref)
101. 0.000 0.000 ↓ 0.0

Index Scan using idx_transaction_msgid_pk on transaction t_1 (cost=0.44..858,105.15 rows=19,593,910 width=48) (actual rows= loops=)

102. 0.000 0.000 ↓ 0.0

Materialize (cost=426,301.88..441,013.41 rows=2,942,305 width=18) (actual rows= loops=)

103. 0.000 0.000 ↓ 0.0

Sort (cost=426,301.88..433,657.64 rows=2,942,305 width=18) (actual rows= loops=)

  • Sort Key: m_1.txref
104. 0.000 0.000 ↓ 0.0

Seq Scan on metering m_1 (cost=0.00..75,691.05 rows=2,942,305 width=18) (actual rows= loops=)

105. 0.000 0.000 ↓ 0.0

Hash (cost=95,707.04..95,707.04 rows=2,867,304 width=22) (actual rows= loops=)

106. 0.000 0.000 ↓ 0.0

Seq Scan on msgenv msg_1 (cost=0.00..95,707.04 rows=2,867,304 width=22) (actual rows= loops=)

107. 0.000 0.000 ↓ 0.0

Hash (cost=63,775.83..63,775.83 rows=454,413 width=29) (actual rows= loops=)

108. 0.000 0.000 ↓ 0.0

Hash Join (cost=36,576.43..63,775.83 rows=454,413 width=29) (actual rows= loops=)

  • Hash Cond: (cdp_1.contractid = contract_1.contractid)
109. 0.000 0.000 ↓ 0.0

Seq Scan on contractdpjournal cdp_1 (cost=0.00..17,543.13 rows=454,413 width=25) (actual rows= loops=)

110. 0.000 0.000 ↓ 0.0

Hash (cost=30,957.30..30,957.30 rows=449,530 width=8) (actual rows= loops=)

111. 0.000 0.000 ↓ 0.0

Seq Scan on contract contract_1 (cost=0.00..30,957.30 rows=449,530 width=8) (actual rows= loops=)

112. 0.000 0.000 ↓ 0.0

Hash (cost=9,436.67..9,436.67 rows=350,267 width=28) (actual rows= loops=)

113. 0.000 0.000 ↓ 0.0

Seq Scan on deliverypoint dp_1 (cost=0.00..9,436.67 rows=350,267 width=28) (actual rows= loops=)

114. 0.000 0.000 ↓ 0.0

Hash (cost=1.02..1.02 rows=2 width=36) (actual rows= loops=)

115. 0.000 0.000 ↓ 0.0

Seq Scan on supplier s_1 (cost=0.00..1.02 rows=2 width=36) (actual rows= loops=)

116. 0.000 0.000 ↓ 0.0

Sort (cost=515.67..516.17 rows=200 width=4) (actual rows= loops=)

  • Sort Key: previousmet.meteringid
117. 0.000 0.000 ↓ 0.0

HashAggregate (cost=506.03..508.03 rows=200 width=4) (actual rows= loops=)

  • Group Key: previousmet.meteringid
118. 0.000 0.000 ↓ 0.0

CTE Scan on previousmet (cost=0.00..449.80 rows=22,490 width=4) (actual rows= loops=)

119. 0.000 0.000 ↓ 0.0

Index Scan using dpj_un on dpconfigjournal dpc_1 (cost=10.87..11.63 rows=1 width=6) (actual rows= loops=)

  • Index Cond: (dpconfigjid = (SubPlan 3))
120.          

SubPlan (for Index Scan)

121. 0.000 0.000 ↓ 0.0

Limit (cost=10.44..10.45 rows=1 width=26) (actual rows= loops=)

122. 0.000 0.000 ↓ 0.0

Sort (cost=10.44..10.45 rows=1 width=26) (actual rows= loops=)

  • Sort Key: ((tx.msgdate)::date), ((j_1.creationdate)::date), j_1.fromdate, j_1.powerlimiter, m_3.budgetmeter
123. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.29..10.43 rows=1 width=26) (actual rows= loops=)

124. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.86..7.98 rows=1 width=29) (actual rows= loops=)

125. 0.000 0.000 ↓ 0.0

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_1 (cost=0.42..5.51 rows=1 width=25) (actual rows= loops=)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: ((fromdate <= i_1.indexdate) AND ((source)::text = 'DGO'::text))
126. 0.000 0.000 ↓ 0.0

Index Scan using idx_transaction_msgid_pk on transaction tx (cost=0.44..2.46 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (msgid = j_1.txref)
127. 0.000 0.000 ↓ 0.0

Index Scan using idx_meter_physicalconfigid_pk on meter m_3 (cost=0.42..2.44 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (j_1.physicalconfigid = physicalconfigid)
128. 0.000 0.000 ↓ 0.0

Index Scan using dpj_un on dpconfigjournal dpc2_1 (cost=26.20..26.96 rows=1 width=6) (actual rows= loops=)

  • Index Cond: (dpconfigjid = (SubPlan 5))
129.          

SubPlan (for Index Scan)

130. 0.000 0.000 ↓ 0.0

Limit (cost=25.77..25.78 rows=1 width=26) (actual rows= loops=)

131.          

Initplan (for Limit)

132. 0.000 0.000 ↓ 0.0

Aggregate (cost=15.32..15.33 rows=1 width=4) (actual rows= loops=)

133. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.85..15.31 rows=4 width=4) (actual rows= loops=)

134. 0.000 0.000 ↓ 0.0

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j1 (cost=0.42..5.50 rows=4 width=12) (actual rows= loops=)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: ((source)::text = 'DGO'::text)
135. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_meter_physicalconfigid_pk on meter m1 (cost=0.42..2.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (physicalconfigid = j1.physicalconfigid)
136. 0.000 0.000 ↓ 0.0

Sort (cost=10.44..10.45 rows=1 width=26) (actual rows= loops=)

  • Sort Key: ((tx_1.msgdate)::date), ((j_2.creationdate)::date), j_2.powerlimiter, m_4.budgetmeter
137. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.29..10.43 rows=1 width=26) (actual rows= loops=)

138. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.86..7.98 rows=1 width=29) (actual rows= loops=)

139. 0.000 0.000 ↓ 0.0

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_2 (cost=0.42..5.51 rows=1 width=25) (actual rows= loops=)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: (((source)::text = 'DGO'::text) AND (fromdate = $10))
140. 0.000 0.000 ↓ 0.0

Index Scan using idx_transaction_msgid_pk on transaction tx_1 (cost=0.44..2.46 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (msgid = j_2.txref)
141. 0.000 0.000 ↓ 0.0

Index Scan using idx_meter_physicalconfigid_pk on meter m_4 (cost=0.42..2.44 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (j_2.physicalconfigid = physicalconfigid)
142. 0.000 0.000 ↓ 0.0

Materialize (cost=0.43..136,051.29 rows=2,846,656 width=17) (actual rows= loops=)

143. 0.000 0.000 ↓ 0.0

Index Scan using idx_index_meteringid on index i2_1 (cost=0.43..128,934.65 rows=2,846,656 width=17) (actual rows= loops=)

144.          

SubPlan (for Merge Left Join)

145. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..18.62 rows=12 width=0) (actual rows= loops=)

146. 0.000 0.000 ↓ 0.0

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal cdp_3 (cost=0.42..3.45 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (pointid = dp_1.pointid)
147. 0.000 0.000 ↓ 0.0

Index Only Scan using process_idx4test on process p (cost=0.43..7.50 rows=9 width=4) (actual rows= loops=)

  • Index Cond: (contractdpid = cdp_3.contractdpid)
148. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=73,615.77..104,306.90 rows=161,452 width=109) (actual rows= loops=)

149. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=73,615.77..102,692.38 rows=161,452 width=109) (actual rows= loops=)

  • Hash Cond: (contract_2.supplierid = s_2.supplierid)
150. 0.000 0.000 ↓ 0.0

Hash Join (cost=73,614.72..88,362.47 rows=161,452 width=81) (actual rows= loops=)

  • Hash Cond: (cdp_2.pointid = dp_2.pointid)
151. 0.000 0.000 ↓ 0.0

Hash Join (cost=59,799.72..71,520.24 rows=161,452 width=64) (actual rows= loops=)

  • Hash Cond: (cdp_2.contractid = contract_2.contractid)
152. 0.000 0.000 ↓ 0.0

Hash Join (cost=23,223.29..31,512.96 rows=161,452 width=60) (actual rows= loops=)

  • Hash Cond: (i_2.contractdpid = cdp_2.contractdpid)
153. 0.000 0.000 ↓ 0.0

Seq Scan on userindex i_2 (cost=0.00..4,858.81 rows=161,452 width=44) (actual rows= loops=)

  • Filter: ((indexdate IS NULL) OR (indexdate <= '9999-12-31 00:00:00+01'::timestamp with time zone))
154. 0.000 0.000 ↓ 0.0

Hash (cost=17,543.13..17,543.13 rows=454,413 width=20) (actual rows= loops=)

155. 0.000 0.000 ↓ 0.0

Seq Scan on contractdpjournal cdp_2 (cost=0.00..17,543.13 rows=454,413 width=20) (actual rows= loops=)

156. 0.000 0.000 ↓ 0.0

Hash (cost=30,957.30..30,957.30 rows=449,530 width=8) (actual rows= loops=)

157. 0.000 0.000 ↓ 0.0

Seq Scan on contract contract_2 (cost=0.00..30,957.30 rows=449,530 width=8) (actual rows= loops=)

158. 0.000 0.000 ↓ 0.0

Hash (cost=9,436.67..9,436.67 rows=350,267 width=25) (actual rows= loops=)

159. 0.000 0.000 ↓ 0.0

Seq Scan on deliverypoint dp_2 (cost=0.00..9,436.67 rows=350,267 width=25) (actual rows= loops=)

160. 0.000 0.000 ↓ 0.0

Hash (cost=1.02..1.02 rows=2 width=36)" -> Seq Scan on supplier s_2 (cost=0.00..1.02 rows=2 width=36) (actual rows= loops=)