explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mrxy

Settings
# exclusive inclusive rows x rows loops node
1. 473.752 13,699.108 ↓ 7.1 98,283 1

HashAggregate (cost=7,977,248.14..7,977,387.00 rows=13,886 width=820) (actual time=13,598.383..13,699.108 rows=98,283 loops=1)

  • Group Key: ('$IXD'::character varying), dp.gsrn, (CASE WHEN (i.previousindexdate IS NULL) THEN i.indexdate WHEN (i.previousindexdate <= '9999-12-31'::date) THEN i.previousindexdate ELSE cdp.fromdate END), (CASE WHEN (i.indexdate <= '9999-12-31'::date) THEN i.indexdate ELSE cdp.todate END), s.gln, cdp.fromdate, cdp.todate, (CASE WHEN (((i.status)::text = 'R'::text) OR ((i.indexdate = i.previousindexdate) AND (alternatives: SubPlan 7 or hashed SubPlan 8))) THEN 'RECTIFIED'::text ELSE 'ACTUAL'::text END), (CASE WHEN ((COALESCE(dpc.switchcateg, dpc2.switchcateg))::text = 'C'::text) THEN 'CONTINUOUS'::text WHEN ((COALESCE(dpc.switchcateg, dpc2.switchcateg))::text = 'M'::text) THEN 'MONTH'::text WHEN ((COALESCE(dpc.switchcateg, dpc2.switchcateg))::text = 'Y'::text) THEN 'YEAR'::text ELSE 'UNKNOWN'::text END), (CASE WHEN (((dp.marketcode)::text = 'EL'::text) AND ((COALESCE(dpc.switchcateg, dpc2.switchcateg))::text = 'C'::text)) THEN 15 WHEN (((dp.marketcode)::text = 'NG'::text) AND ((COALESCE(dpc.switchcateg, dpc2.switchcateg))::text = 'C'::text)) THEN 60 WHEN ((COALESCE(dpc.switchcateg, dpc2.switchcateg))::text = 'M'::text) THEN 1 WHEN ((COALESCE(dpc.switchcateg, dpc2.switchcateg))::text = 'Y'::text) THEN 1 ELSE 1 END), (CASE WHEN ((t.reason)::text = 'E23'::text) THEN 'PERIODIC_METERING'::text WHEN ((t.reason)::text = 'E53'::text) THEN 'METERING_ON_DEMAND'::text WHEN ((t.reason)::text = 'B95'::text) THEN 'AD_HOC'::text WHEN ((t.reason)::text = 'E24'::text) THEN 'MDCHANGE'::text WHEN ((t.reason)::text = 'E03'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'B74'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'B75'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'E40'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'BB1'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'BB2'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'E35'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'BC0'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'E20'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'E06'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'B90'::text) THEN 'LOSS'::text WHEN ((t.reason)::text = 'E21'::text) THEN 'CUSTOMER_SWITCH'::text WHEN ((t.reason)::text = 'E25'::text) THEN 'MDCHANGE'::text WHEN ((t.reason)::text = 'ERR'::text) THEN 'RECTIFICATION'::text WHEN ((t.reason)::text = 'B03'::text) THEN 'MDCHANGE'::text WHEN ((t.reason)::text = 'B04'::text) THEN 'MDCHANGE'::text WHEN ((t.reason)::text = 'BA1'::text) THEN 'MDCHANGE'::text WHEN ((t.reason)::text = 'BA2'::text) THEN 'MDCHANGE'::text WHEN ((t.reason)::text = 'E01'::text) THEN 'GAIN'::text WHEN ((t.reason)::text = 'E30'::text) THEN 'GAIN'::text WHEN ((t.reason)::text = 'BA9'::text) THEN 'LOSS'::text ELSE 'UNKNOWN'::text END), (COALESCE(i.meternumber, 'NA'::character varying)), i.registername, (CASE WHEN (((i.type)::text = 'A'::text) AND ((i.unit)::text = 'KW'::text)) THEN 'ACTIVE_POWER'::text WHEN (((i.type)::text = 'A'::text) AND ((i.unit)::text = 'KWH'::text)) THEN 'ACTIVE_ENERGY'::text WHEN (((i.type)::text = 'A'::text) AND ((i.unit)::text = 'MTQ'::text)) THEN 'ACTIVE_POWER'::text WHEN (((i.type)::text = 'B29'::text) AND ((i.unit)::text = 'KRH'::text)) THEN 'REACTIVE_CAPACITIVE_ENERGY'::text WHEN (((i.type)::text = 'BCW'::text) AND ((i.unit)::text = 'KRH'::text)) THEN 'REACTIVE_CAPACITIVE_ENERGY'::text WHEN (((i.type)::text = 'B30'::text) AND ((i.unit)::text = 'KRH'::text)) THEN 'REACTIVE_INDUCTIVE_ENERGY'::text WHEN (((i.type)::text = 'BCX'::text) AND ((i.unit)::text = 'KRH'::text)) THEN 'REACTIVE_INDUCTIVE_ENERGY'::text WHEN (((i.type)::text = 'B31'::text) AND ((i.unit)::text = 'D90'::text)) THEN 'NORMALIZED_VOLUME'::text WHEN (((i.type)::text = 'BCY'::text) AND ((i.unit)::text = 'KWH'::text)) THEN 'ACTIVE_ENERGY'::text WHEN (((i.type)::text = 'B31'::text) AND ((i.unit)::text = 'KWH'::text)) THEN 'ACTIVE_ENERGY'::text WHEN (((i.type)::text = 'B31'::text) AND ((i.unit)::text = 'MTQ'::text)) THEN 'VOLUME'::text WHEN (((i.type)::text = 'B47'::text) AND ((i.unit)::text = 'KW'::text)) THEN 'ACTIVE_POWER'::text WHEN (((i.type)::text = 'RC'::text) AND ((i.unit)::text = 'KRH'::text)) THEN 'REACTIVE_CAPACITIVE_ENERGY'::text WHEN (((i.type)::text = 'RI'::text) AND ((i.unit)::text = 'KRH'::text)) THEN 'REACTIVE_INDUCTIVE_ENERGY'::text WHEN ((i.unit)::text = 'MTQ'::text) THEN 'VOLUME'::text WHEN (((i.unit)::text = 'KRH'::text) AND ((i.registername)::text ~~* '%B29%'::text)) THEN 'REACTIVE_CAPACITIVE_ENERGY'::text WHEN (((i.unit)::text = 'KRH'::text) AND ((i.registername)::text ~~* '%B30%'::text)) THEN 'REACTIVE_INDUCTIVE_ENERGY'::text WHEN ((i.unit)::text = 'KRH'::text) THEN 'UNKNOWN'::text WHEN ((i.unit)::text = 'KW'::text) THEN 'ACTIVE_POWER'::text WHEN ((i.unit)::text = 'KWH'::text) THEN 'ACTIVE_ENERGY'::text WHEN ((i.unit IS NULL) OR ((i.unit)::text = ''::text)) THEN 'UNKNOWN'::text ELSE 'UNKNOWN'::text END), (CASE WHEN ((i.timeframe)::text = 'B36'::text) THEN 'NIGHT_EXCLUSIVE'::text WHEN ((i.timeframe)::text = ANY ('{E11,e11,J11}'::text[])) THEN 'HIGH'::text WHEN ((i.timeframe)::text = ANY ('{E10,e10,J10}'::text[])) THEN 'LOW'::text WHEN ((i.timeframe)::text = 'NPK'::text) THEN 'NON_PEAK'::text WHEN ((i.timeframe)::text = 'NPH'::text) THEN 'NON_PEAK_HIGH'::text WHEN ((i.timeframe)::text = 'NPL'::text) THEN 'NON_PEAK_LOW'::text WHEN ((i.timeframe)::text = 'E12'::text) THEN 'PEAK'::text WHEN ((i.timeframe)::text = 'PKH'::text) THEN 'PEAK_HIGH'::text WHEN ((i.timeframe)::text = 'PKL'::text) THEN 'PEAK_LOW'::text WHEN ((i.timeframe)::text = ANY ('{B37,b37}'::text[])) THEN 'TOTAL_HOUR'::text WHEN ((i.timeframe)::text = 'B48'::text) THEN 'NOT_USED'::text ELSE 'UNKNOWN'::text END), (CASE WHEN ((i.type)::text = ANY ('{BCW,BCX,BCY}'::text[])) THEN 'PRODUCTION'::text WHEN ((dp.direction)::text = 'I'::text) THEN 'PRODUCTION'::text ELSE 'CONSUMPTION'::text END), ((('{'::text || (i.index)::text) || '}'::text)), ((('{'::text || CASE WHEN ((i.quality)::text = 'estimated'::text) THEN 'ESTIMATED'::text WHEN ((i.quality)::text = 'ratified'::text) THEN 'VALIDATED'::text WHEN ((i.quality)::text = 'adjusted'::text) THEN 'ADJUSTED'::text WHEN ((i.quality)::text = 'revised'::text) THEN 'CORRECTED'::text WHEN ((i.quality)::text = 'unchanged'::text) THEN 'UNCHANGED'::text WHEN ((i.quality)::text = 'significant'::text) THEN 'OVERESTIMATED'::text WHEN ((i.quality)::text = 'for-agreement'::text) THEN 'VALID_PROVIDED_BY_THIRD_PARTY'::text ELSE 'MISSING'::text END) || '}'::text)), ('{UNDEFINED}'::character varying), (CASE WHEN ((t.msgandtxids IS NOT NULL) AND ((t.msgandtxids)::text !~~ '%dummy%'::text)) THEN "substring"((t.msgandtxids)::text, ("position"((t.msgandtxids)::text, '+'::text) + 1)) WHEN ((t.msgandtxids)::text ~~ '%dummy%'::text) THEN 'NA'::text WHEN (msg.interchangeid IS NOT NULL) THEN (msg.interchangeid)::text ELSE ('USER_IXD_'::text || (i.meteringid)::text) END), (CASE WHEN ((t.msgandtxids IS NOT NULL) AND ((t.msgandtxids)::text !~~ '%dummy%'::text)) THEN to_char(t.msgdate, 'YYYY-MM-DD HH24:MI:SS'::text) WHEN (msg.interchangeid IS NOT NULL) THEN to_char(msg.creationdate, 'YYYY-MM-DD HH24:MI:SS'::text) ELSE to_char(i.creationdate, 'YYYY-MM-DD HH24:MI:SS'::text) END), (CASE WHEN ((cdp.sourceid)::text = 'USER'::text) THEN 'USER'::text WHEN ((cdp.fromdate = cdp.todate) AND (NOT (alternatives: SubPlan 9 or hashed SubPlan 10))) THEN 'USER'::text WHEN ((m.source)::text = 'USER'::text) THEN 'USER'::text ELSE 'DGO'::text END), (CASE m.historical WHEN CASE_TEST_EXPR THEN 't'::text ELSE 'f'::text END), ('1'::character varying), (NULL::text), ((cdp.contractid)::character varying), (CASE m.ignored WHEN CASE_TEST_EXPR THEN 't'::text WHEN (NOT CASE_TEST_EXPR) THEN 'f'::text ELSE NULL::text END), ('$CUS'::character varying), ((cdp.contractdpid)::character varying)
2. 31.377 13,225.356 ↑ 1.4 99,669 1

Append (cost=71,550.85..7,965,445.12 rows=138,859 width=204) (actual time=2,192.211..13,225.356 rows=99,669 loops=1)

3.          

CTE previousmet

4. 0.890 598.347 ↑ 1.7 1,096 1

HashAggregate (cost=26,762.45..26,780.94 rows=1,849 width=4) (actual time=598.137..598.347 rows=1,096 loops=1)

  • Group Key: i_3.meteringid
5. 113.350 597.457 ↓ 1.2 2,132 1

Merge Anti Join (cost=24,926.04..26,757.83 rows=1,849 width=4) (actual time=464.039..597.457 rows=2,132 loops=1)

  • Merge Cond: ((j.pointid = contractdpjournal.pointid) AND (i_3.previousindexdate = index.indexdate) 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))
6. 71.633 239.227 ↓ 2.3 63,890 1

Sort (cost=9,514.67..9,584.81 rows=28,056 width=29) (actual time=230.063..239.227 rows=63,890 loops=1)

  • Sort Key: j.pointid, i_3.previousindexdate, i_3.previousindex, i_3.timeframe, i_3.unit, i_3.type
  • Sort Method: quicksort Memory: 6,528kB
7. 36.024 167.594 ↓ 2.3 63,890 1

Hash Join (cost=3,152.49..7,441.89 rows=28,056 width=29) (actual time=33.527..167.594 rows=63,890 loops=1)

  • Hash Cond: (m_2.contractdpid = j.contractdpid)
8. 57.757 127.259 ↓ 2.3 63,890 1

Hash Join (cost=2,605.57..6,368.91 rows=28,056 width=29) (actual time=29.197..127.259 rows=63,890 loops=1)

  • Hash Cond: (i_3.meteringid = m_2.meteringid)
9. 40.366 40.366 ↓ 2.3 63,890 1

Seq Scan on index i_3 (cost=0.00..3,132.09 rows=28,056 width=25) (actual time=0.034..40.366 rows=63,890 loops=1)

  • Filter: (previousindexdate < indexdate)
  • Rows Removed by Filter: 20,277
10. 13.997 29.136 ↑ 1.0 68,114 1

Hash (cost=1,754.14..1,754.14 rows=68,114 width=8) (actual time=29.136..29.136 rows=68,114 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 2,661kB
11. 15.139 15.139 ↑ 1.0 68,114 1

Seq Scan on metering m_2 (cost=0.00..1,754.14 rows=68,114 width=8) (actual time=0.004..15.139 rows=68,114 loops=1)

12. 2.197 4.311 ↑ 1.0 10,619 1

Hash (cost=414.19..414.19 rows=10,619 width=8) (actual time=4.311..4.311 rows=10,619 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 415kB
13. 2.114 2.114 ↑ 1.0 10,619 1

Seq Scan on contractdpjournal j (cost=0.00..414.19 rows=10,619 width=8) (actual time=0.004..2.114 rows=10,619 loops=1)

14. 84.078 244.880 ↑ 1.0 76,473 1

Sort (cost=15,411.37..15,602.92 rows=76,617 width=25) (actual time=233.966..244.880 rows=76,473 loops=1)

  • Sort Key: contractdpjournal.pointid, index.indexdate, index.index, index.timeframe, index.unit, index.type
  • Sort Method: quicksort Memory: 9,045kB
15. 36.711 160.802 ↑ 1.0 76,481 1

Hash Join (cost=548.20..9,195.68 rows=76,617 width=25) (actual time=5.027..160.802 rows=76,481 loops=1)

  • Hash Cond: (metering.contractdpid = contractdpjournal.contractdpid)
16. 45.078 119.130 ↑ 1.0 76,481 1

Merge Join (cost=1.27..7,212.18 rows=76,617 width=25) (actual time=0.051..119.130 rows=76,481 loops=1)

  • Merge Cond: (metering.meteringid = index.meteringid)
17. 28.972 28.972 ↑ 1.0 68,114 1

Index Scan using idx_metering_contractdpid on metering (cost=0.29..2,284.00 rows=68,114 width=8) (actual time=0.022..28.972 rows=68,114 loops=1)

18. 45.080 45.080 ↑ 1.0 76,481 1

Index Scan using idx_index_meteringid on index (cost=0.29..3,800.22 rows=76,617 width=25) (actual time=0.015..45.080 rows=76,481 loops=1)

  • Filter: ((status)::text = 'A'::text)
  • Rows Removed by Filter: 7,686
19. 2.243 4.961 ↑ 1.0 10,619 1

Hash (cost=414.19..414.19 rows=10,619 width=8) (actual time=4.961..4.961 rows=10,619 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 415kB
20. 2.718 2.718 ↑ 1.0 10,619 1

Seq Scan on contractdpjournal (cost=0.00..414.19 rows=10,619 width=8) (actual time=0.008..2.718 rows=10,619 loops=1)

21. 1,546.365 11,136.679 ↓ 1.0 84,173 1

Nested Loop Left Join (cost=44,769.91..6,780,758.28 rows=84,167 width=217) (actual time=2,192.209..11,136.679 rows=84,173 loops=1)

  • Join Filter: (i.previousindexdate = i.indexdate)
  • Rows Removed by Join Filter: 792
22. 3,333.920 8,543.222 ↑ 1.0 84,167 1

Nested Loop Left Join (cost=44,769.61..2,040,835.14 rows=84,167 width=221) (actual time=1,456.053..8,543.222 rows=84,167 loops=1)

  • Join Filter: (dpc.dpconfigjid IS NULL)
  • Rows Removed by Join Filter: 84,166
23. 3,031.598 4,956.801 ↑ 1.0 84,167 1

Nested Loop Left Join (cost=44,754.08..727,475.28 rows=84,167 width=223) (actual time=1,455.885..4,956.801 rows=84,167 loops=1)

24. 191.659 1,672.702 ↑ 1.0 84,167 1

Hash Join (cost=44,746.10..49,561.52 rows=84,167 width=217) (actual time=1,455.722..1,672.702 rows=84,167 loops=1)

  • Hash Cond: (i.meteringid = m.meteringid)
25. 25.423 25.423 ↑ 1.0 84,167 1

Seq Scan on index i (cost=0.00..2,921.67 rows=84,167 width=71) (actual time=0.079..25.423 rows=84,167 loops=1)

26. 60.027 1,455.620 ↑ 1.0 68,114 1

Hash (cost=43,894.67..43,894.67 rows=68,114 width=150) (actual time=1,455.620..1,455.620 rows=68,114 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 11,385kB
27. 70.958 1,395.593 ↑ 1.0 68,114 1

Hash Left Join (cost=13,837.82..43,894.67 rows=68,114 width=150) (actual time=332.060..1,395.593 rows=68,114 loops=1)

  • Hash Cond: (t.envid = msg.envid)
28. 81.475 1,085.943 ↑ 1.0 68,114 1

Hash Join (cost=4,657.67..33,353.26 rows=68,114 width=137) (actual time=93.308..1,085.943 rows=68,114 loops=1)

  • Hash Cond: (m.contractdpid = cdp.contractdpid)
29. 522.378 957.633 ↑ 1.0 68,114 1

Hash Right Join (cost=2,605.57..30,024.02 rows=68,114 width=57) (actual time=46.463..957.633 rows=68,114 loops=1)

  • Hash Cond: (t.msgid = m.txref)
30. 389.888 389.888 ↑ 1.0 564,873 1

Seq Scan on transaction t (cost=0.00..19,731.73 rows=564,873 width=47) (actual time=0.005..389.888 rows=564,873 loops=1)

31. 17.847 45.367 ↑ 1.0 68,114 1

Hash (cost=1,754.14..1,754.14 rows=68,114 width=18) (actual time=45.367..45.367 rows=68,114 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 3,438kB
32. 27.520 27.520 ↑ 1.0 68,114 1

Seq Scan on metering m (cost=0.00..1,754.14 rows=68,114 width=18) (actual time=0.006..27.520 rows=68,114 loops=1)

33. 5.380 46.835 ↑ 1.0 10,619 1

Hash (cost=1,919.37..1,919.37 rows=10,619 width=84) (actual time=46.835..46.835 rows=10,619 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 1,036kB
34. 4.958 41.455 ↑ 1.0 10,619 1

Hash Left Join (cost=592.74..1,919.37 rows=10,619 width=84) (actual time=6.611..41.455 rows=10,619 loops=1)

  • Hash Cond: (contract.supplierid = s.supplierid)
35. 6.681 36.492 ↑ 1.0 10,619 1

Hash Join (cost=591.70..1,772.31 rows=10,619 width=56) (actual time=6.601..36.492 rows=10,619 loops=1)

  • Hash Cond: (cdp.contractid = contract.contractid)
36. 7.421 23.257 ↑ 1.0 10,619 1

Merge Join (cost=0.61..982.12 rows=10,619 width=52) (actual time=0.024..23.257 rows=10,619 loops=1)

  • Merge Cond: (dp.pointid = cdp.pointid)
37. 6.522 6.522 ↑ 1.0 8,487 1

Index Scan using deliverypoint_pkey on deliverypoint dp (cost=0.29..290.59 rows=8,487 width=27) (actual time=0.010..6.522 rows=8,487 loops=1)

38. 9.314 9.314 ↑ 1.0 10,619 1

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal cdp (cost=0.29..537.57 rows=10,619 width=25) (actual time=0.006..9.314 rows=10,619 loops=1)

39. 2.104 6.554 ↑ 1.0 10,404 1

Hash (cost=461.04..461.04 rows=10,404 width=8) (actual time=6.554..6.554 rows=10,404 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 407kB
40. 4.450 4.450 ↑ 1.0 10,404 1

Seq Scan on contract (cost=0.00..461.04 rows=10,404 width=8) (actual time=0.015..4.450 rows=10,404 loops=1)

41. 0.001 0.005 ↑ 1.0 2 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
42. 0.004 0.004 ↑ 1.0 2 1

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

43. 73.027 238.692 ↑ 1.0 194,940 1

Hash (cost=6,743.40..6,743.40 rows=194,940 width=21) (actual time=238.692..238.692 rows=194,940 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 10,849kB
44. 165.665 165.665 ↑ 1.0 194,940 1

Seq Scan on msgenv msg (cost=0.00..6,743.40 rows=194,940 width=21) (actual time=0.021..165.665 rows=194,940 loops=1)

45. 0.000 252.501 ↑ 1.0 1 84,167

Index Scan using dpj_un on dpconfigjournal dpc (cost=7.98..8.04 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=84,167)

  • Index Cond: (dpconfigjid = (SubPlan 11))
46.          

SubPlan (for Index Scan)

47. 84.167 2,861.678 ↑ 1.0 1 84,167

Limit (cost=7.69..7.70 rows=1 width=26) (actual time=0.034..0.034 rows=1 loops=84,167)

48. 505.002 2,777.511 ↑ 1.0 1 84,167

Sort (cost=7.69..7.70 rows=1 width=26) (actual time=0.033..0.033 rows=1 loops=84,167)

  • Sort Key: ((tx_2.msgdate)::date), ((j_3.creationdate)::date), j_3.fromdate, j_3.powerlimiter, m_5.budgetmeter
  • Sort Method: quicksort Memory: 25kB
49. 237.084 2,272.509 ↓ 2.0 2 84,167

Nested Loop Left Join (cost=0.99..7.68 rows=1 width=26) (actual time=0.015..0.027 rows=2 loops=84,167)

50. 231.945 1,515.006 ↓ 2.0 2 84,167

Nested Loop Left Join (cost=0.71..5.37 rows=1 width=29) (actual time=0.010..0.018 rows=2 loops=84,167)

51. 589.169 589.169 ↓ 2.0 2 84,167

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_3 (cost=0.29..2.91 rows=1 width=25) (actual time=0.004..0.007 rows=2 loops=84,167)

  • Index Cond: (pointid = dp.pointid)
  • Filter: ((fromdate <= i.indexdate) AND ((source)::text = 'DGO'::text))
  • Rows Removed by Filter: 1
52. 693.892 693.892 ↑ 1.0 1 173,473

Index Scan using idx_transaction_msgid_pk on transaction tx_2 (cost=0.42..2.44 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=173,473)

  • Index Cond: (msgid = j_3.txref)
53. 520.419 520.419 ↑ 1.0 1 173,473

Index Scan using idx_meter_physicalconfigid_pk on meter m_5 (cost=0.29..2.30 rows=1 width=5) (actual time=0.003..0.003 rows=1 loops=173,473)

  • Index Cond: (j_3.physicalconfigid = physicalconfigid)
54. 84.167 2,861.678 ↑ 1.0 1 84,167

Limit (cost=7.69..7.70 rows=1 width=26) (actual time=0.034..0.034 rows=1 loops=84,167)

55. 505.002 2,777.511 ↑ 1.0 1 84,167

Sort (cost=7.69..7.70 rows=1 width=26) (actual time=0.033..0.033 rows=1 loops=84,167)

  • Sort Key: ((tx_2.msgdate)::date), ((j_3.creationdate)::date), j_3.fromdate, j_3.powerlimiter, m_5.budgetmeter
  • Sort Method: quicksort Memory: 25kB
56. 237.084 2,272.509 ↓ 2.0 2 84,167

Nested Loop Left Join (cost=0.99..7.68 rows=1 width=26) (actual time=0.015..0.027 rows=2 loops=84,167)

57. 231.945 1,515.006 ↓ 2.0 2 84,167

Nested Loop Left Join (cost=0.71..5.37 rows=1 width=29) (actual time=0.010..0.018 rows=2 loops=84,167)

58. 589.169 589.169 ↓ 2.0 2 84,167

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_3 (cost=0.29..2.91 rows=1 width=25) (actual time=0.004..0.007 rows=2 loops=84,167)

  • Index Cond: (pointid = dp.pointid)
  • Filter: ((fromdate <= i.indexdate) AND ((source)::text = 'DGO'::text))
  • Rows Removed by Filter: 1
59. 693.892 693.892 ↑ 1.0 1 173,473

Index Scan using idx_transaction_msgid_pk on transaction tx_2 (cost=0.42..2.44 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=173,473)

  • Index Cond: (msgid = j_3.txref)
60. 520.419 520.419 ↑ 1.0 1 173,473

Index Scan using idx_meter_physicalconfigid_pk on meter m_5 (cost=0.29..2.30 rows=1 width=5) (actual time=0.003..0.003 rows=1 loops=173,473)

  • Index Cond: (j_3.physicalconfigid = physicalconfigid)
61. 0.000 252.501 ↑ 1.0 1 84,167

Index Scan using dpj_un on dpconfigjournal dpc2 (cost=15.53..15.59 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=84,167)

  • Index Cond: (dpconfigjid = (SubPlan 13))
62.          

SubPlan (for Index Scan)

63. 0.000 3,114.179 ↑ 1.0 1 84,167

Limit (cost=15.24..15.25 rows=1 width=26) (actual time=0.037..0.037 rows=1 loops=84,167)

64.          

Initplan (for Limit)

65. 84.167 1,346.672 ↑ 1.0 1 84,167

Aggregate (cost=7.54..7.55 rows=1 width=4) (actual time=0.016..0.016 rows=1 loops=84,167)

66. 127.763 1,262.505 ↓ 1.5 3 84,167

Nested Loop Left Join (cost=0.57..7.53 rows=2 width=4) (actual time=0.006..0.015 rows=3 loops=84,167)

67. 420.835 420.835 ↓ 1.5 3 84,167

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j1_1 (cost=0.29..2.91 rows=2 width=12) (actual time=0.003..0.005 rows=3 loops=84,167)

  • Index Cond: (pointid = dp.pointid)
  • Filter: ((source)::text = 'DGO'::text)
68. 713.907 713.907 ↑ 1.0 1 237,969

Index Only Scan using idx_meter_physicalconfigid_pk on meter m1_1 (cost=0.29..2.30 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=237,969)

  • Index Cond: (physicalconfigid = j1_1.physicalconfigid)
  • Heap Fetches: 265,022
69. 336.668 3,114.179 ↑ 1.0 1 84,167

Sort (cost=7.69..7.70 rows=1 width=26) (actual time=0.037..0.037 rows=1 loops=84,167)

  • Sort Key: ((tx_3.msgdate)::date), ((j_4.creationdate)::date), j_4.powerlimiter, m_6.budgetmeter
  • Sort Method: quicksort Memory: 25kB
70. 218.779 2,777.511 ↑ 1.0 1 84,167

Nested Loop Left Join (cost=0.99..7.68 rows=1 width=26) (actual time=0.028..0.033 rows=1 loops=84,167)

71. 201.918 2,356.676 ↑ 1.0 1 84,167

Nested Loop Left Join (cost=0.71..5.37 rows=1 width=29) (actual time=0.024..0.028 rows=1 loops=84,167)

72. 1,851.674 1,851.674 ↑ 1.0 1 84,167

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_4 (cost=0.29..2.91 rows=1 width=25) (actual time=0.020..0.022 rows=1 loops=84,167)

  • Index Cond: (pointid = dp.pointid)
  • Filter: (((source)::text = 'DGO'::text) AND (fromdate = $36))
  • Rows Removed by Filter: 2
73. 303.084 303.084 ↑ 1.0 1 101,028

Index Scan using idx_transaction_msgid_pk on transaction tx_3 (cost=0.42..2.44 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=101,028)

  • Index Cond: (msgid = j_4.txref)
74. 202.056 202.056 ↑ 1.0 1 101,028

Index Scan using idx_meter_physicalconfigid_pk on meter m_6 (cost=0.29..2.30 rows=1 width=5) (actual time=0.002..0.002 rows=1 loops=101,028)

  • Index Cond: (j_4.physicalconfigid = physicalconfigid)
75. 0.000 3,114.179 ↑ 1.0 1 84,167

Limit (cost=15.24..15.25 rows=1 width=26) (actual time=0.037..0.037 rows=1 loops=84,167)

76.          

Initplan (for Limit)

77. 84.167 1,346.672 ↑ 1.0 1 84,167

Aggregate (cost=7.54..7.55 rows=1 width=4) (actual time=0.016..0.016 rows=1 loops=84,167)

78. 127.763 1,262.505 ↓ 1.5 3 84,167

Nested Loop Left Join (cost=0.57..7.53 rows=2 width=4) (actual time=0.006..0.015 rows=3 loops=84,167)

79. 420.835 420.835 ↓ 1.5 3 84,167

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j1_1 (cost=0.29..2.91 rows=2 width=12) (actual time=0.003..0.005 rows=3 loops=84,167)

  • Index Cond: (pointid = dp.pointid)
  • Filter: ((source)::text = 'DGO'::text)
80. 713.907 713.907 ↑ 1.0 1 237,969

Index Only Scan using idx_meter_physicalconfigid_pk on meter m1_1 (cost=0.29..2.30 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=237,969)

  • Index Cond: (physicalconfigid = j1_1.physicalconfigid)
  • Heap Fetches: 265,022
81. 336.668 3,114.179 ↑ 1.0 1 84,167

Sort (cost=7.69..7.70 rows=1 width=26) (actual time=0.037..0.037 rows=1 loops=84,167)

  • Sort Key: ((tx_3.msgdate)::date), ((j_4.creationdate)::date), j_4.powerlimiter, m_6.budgetmeter
  • Sort Method: quicksort Memory: 25kB
82. 218.779 2,777.511 ↑ 1.0 1 84,167

Nested Loop Left Join (cost=0.99..7.68 rows=1 width=26) (actual time=0.028..0.033 rows=1 loops=84,167)

83. 201.918 2,356.676 ↑ 1.0 1 84,167

Nested Loop Left Join (cost=0.71..5.37 rows=1 width=29) (actual time=0.024..0.028 rows=1 loops=84,167)

84. 1,851.674 1,851.674 ↑ 1.0 1 84,167

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_4 (cost=0.29..2.91 rows=1 width=25) (actual time=0.020..0.022 rows=1 loops=84,167)

  • Index Cond: (pointid = dp.pointid)
  • Filter: (((source)::text = 'DGO'::text) AND (fromdate = $36))
  • Rows Removed by Filter: 2
85. 303.084 303.084 ↑ 1.0 1 101,028

Index Scan using idx_transaction_msgid_pk on transaction tx_3 (cost=0.42..2.44 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=101,028)

  • Index Cond: (msgid = j_4.txref)
86. 202.056 202.056 ↑ 1.0 1 101,028

Index Scan using idx_meter_physicalconfigid_pk on meter m_6 (cost=0.29..2.30 rows=1 width=5) (actual time=0.002..0.002 rows=1 loops=101,028)

  • Index Cond: (j_4.physicalconfigid = physicalconfigid)
87. 336.668 336.668 ↓ 0.0 0 84,167

Index Scan using idx_index_meteringid on index i2 (cost=0.29..0.38 rows=1 width=19) (actual time=0.004..0.004 rows=0 loops=84,167)

  • Index Cond: (i.meteringid = meteringid)
  • Filter: ((i.meterid <> meterid) AND ((i.timeframe)::text = (timeframe)::text) AND ((i.unit)::text = (unit)::text) AND ((i.type)::text = (type)::text))
  • Rows Removed by Filter: 2
88.          

SubPlan (for Nested Loop Left Join)

89. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=50.07..53.70 rows=1 width=0) (never executed)

90. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=49.78..52.54 rows=3 width=8) (never executed)

  • Hash Cond: (previousmet_1.meteringid = m3.meteringid)
91. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=41.60..43.60 rows=200 width=4) (never executed)

  • Group Key: previousmet_1.meteringid
92. 0.000 0.000 ↓ 0.0 0

CTE Scan on previousmet previousmet_1 (cost=0.00..36.98 rows=1,849 width=4) (never executed)

93. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.10..8.10 rows=6 width=4) (never executed)

94. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.58..8.10 rows=6 width=4) (never executed)

95. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal j3 (cost=0.29..2.30 rows=1 width=4) (never executed)

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

Index Scan using idx_metering_contractdpid_2 on metering m3 (cost=0.29..5.73 rows=7 width=8) (never executed)

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

Index Scan using idx_index_meteringid on index i3 (cost=0.29..0.38 rows=1 width=4) (never executed)

  • Index Cond: (meteringid = m3.meteringid)
  • Filter: ((previousindexdate = i.indexdate) AND ((status)::text = 'A'::text))
98. 1.071 641.967 ↑ 22.4 1,710 1

Hash Join (cost=3,194.39..5,015.67 rows=38,308 width=8) (actual time=633.079..641.967 rows=1,710 loops=1)

  • Hash Cond: (m3_1.contractdpid = j3_1.contractdpid)
99. 1.280 635.926 ↑ 22.4 1,710 1

Hash Join (cost=2,647.46..3,750.47 rows=38,308 width=8) (actual time=628.083..635.926 rows=1,710 loops=1)

  • Hash Cond: (i3_1.meteringid = m3_1.meteringid)
100. 0.873 605.648 ↑ 22.4 1,710 1

Nested Loop (cost=41.90..282.97 rows=38,308 width=12) (actual time=599.040..605.648 rows=1,710 loops=1)

101. 0.615 599.295 ↓ 5.5 1,096 1

HashAggregate (cost=41.60..43.60 rows=200 width=4) (actual time=599.015..599.295 rows=1,096 loops=1)

  • Group Key: previousmet_2.meteringid
102. 598.680 598.680 ↑ 1.7 1,096 1

CTE Scan on previousmet previousmet_2 (cost=0.00..36.98 rows=1,849 width=4) (actual time=598.141..598.680 rows=1,096 loops=1)

103. 5.480 5.480 ↑ 1.0 2 1,096

Index Scan using idx_index_meteringid on index i3_1 (cost=0.29..1.18 rows=2 width=8) (actual time=0.004..0.005 rows=2 loops=1,096)

  • Index Cond: (meteringid = previousmet_2.meteringid)
  • Filter: ((status)::text = 'A'::text)
  • Rows Removed by Filter: 1
104. 13.982 28.998 ↑ 1.0 68,114 1

Hash (cost=1,754.14..1,754.14 rows=68,114 width=8) (actual time=28.998..28.998 rows=68,114 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 2,661kB
105. 15.016 15.016 ↑ 1.0 68,114 1

Seq Scan on metering m3_1 (cost=0.00..1,754.14 rows=68,114 width=8) (actual time=0.008..15.016 rows=68,114 loops=1)

106. 2.195 4.970 ↑ 1.0 10,619 1

Hash (cost=414.19..414.19 rows=10,619 width=8) (actual time=4.970..4.970 rows=10,619 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 415kB
107. 2.775 2.775 ↑ 1.0 10,619 1

Seq Scan on contractdpjournal j3_1 (cost=0.00..414.19 rows=10,619 width=8) (actual time=0.005..2.775 rows=10,619 loops=1)

108. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..8.64 rows=6 width=0) (never executed)

109. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal cdp_5 (cost=0.29..2.30 rows=1 width=4) (never executed)

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

Index Only Scan using process_idx4test on process p_2 (cost=0.29..6.27 rows=7 width=4) (never executed)

  • Index Cond: (contractdpid = cdp_5.contractdpid)
  • Heap Fetches: 0
111. 40.605 68.457 ↑ 1.0 61,691 1

Hash Join (cost=546.93..3,359.54 rows=61,691 width=4) (actual time=4.831..68.457 rows=61,691 loops=1)

  • Hash Cond: (p_3.contractdpid = cdp_6.contractdpid)
112. 23.084 23.084 ↑ 1.0 61,691 1

Seq Scan on process p_3 (cost=0.00..1,655.91 rows=61,691 width=4) (actual time=0.029..23.084 rows=61,691 loops=1)

113. 2.159 4.768 ↑ 1.0 10,619 1

Hash (cost=414.19..414.19 rows=10,619 width=8) (actual time=4.768..4.768 rows=10,619 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 415kB
114. 2.609 2.609 ↑ 1.0 10,619 1

Seq Scan on contractdpjournal cdp_6 (cost=0.00..414.19 rows=10,619 width=8) (actual time=0.005..2.609 rows=10,619 loops=1)

115. 1.671 1,861.182 ↑ 15.4 2,728 1

Subquery Scan on *SELECT* 2 (cost=44,816.01..1,153,362.49 rows=41,988 width=209) (actual time=1,371.448..1,861.182 rows=2,728 loops=1)

116. 62.609 1,859.511 ↑ 15.4 2,728 1

Nested Loop Left Join (cost=44,816.01..1,152,942.61 rows=41,988 width=209) (actual time=1,371.445..1,859.511 rows=2,728 loops=1)

  • Join Filter: (i_1.previousindexdate = i_1.indexdate)
  • Rows Removed by Join Filter: 44
117. 105.424 1,735.942 ↑ 15.4 2,728 1

Nested Loop Left Join (cost=44,815.72..1,043,298.12 rows=41,988 width=217) (actual time=1,371.333..1,735.942 rows=2,728 loops=1)

  • Join Filter: (dpc_1.dpconfigjid IS NULL)
  • Rows Removed by Join Filter: 2,728
118. 94.181 1,622.334 ↑ 15.4 2,728 1

Nested Loop Left Join (cost=44,800.18..388,108.39 rows=41,988 width=219) (actual time=1,371.250..1,622.334 rows=2,728 loops=1)

119. 15.233 1,519.969 ↑ 15.4 2,728 1

Hash Join (cost=44,792.20..49,920.71 rows=41,988 width=213) (actual time=1,371.141..1,519.969 rows=2,728 loops=1)

  • Hash Cond: (m_1.meteringid = previousmet.meteringid)
120. 106.265 1,503.942 ↓ 1.0 84,080 1

Hash Join (cost=44,746.10..49,557.22 rows=83,976 width=217) (actual time=1,370.327..1,503.942 rows=84,080 loops=1)

  • Hash Cond: (i_1.meteringid = m_1.meteringid)
121. 27.419 27.419 ↓ 1.0 84,080 1

Seq Scan on index i_1 (cost=0.00..2,921.67 rows=83,976 width=71) (actual time=0.028..27.419 rows=84,080 loops=1)

  • Filter: ((previousindexdate IS NOT NULL) AND (previousindex IS NOT NULL))
  • Rows Removed by Filter: 87
122. 59.179 1,370.258 ↑ 1.0 68,114 1

Hash (cost=43,894.67..43,894.67 rows=68,114 width=146) (actual time=1,370.258..1,370.258 rows=68,114 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 11,168kB
123. 68.250 1,311.079 ↑ 1.0 68,114 1

Hash Left Join (cost=13,837.82..43,894.67 rows=68,114 width=146) (actual time=323.970..1,311.079 rows=68,114 loops=1)

  • Hash Cond: (t_1.envid = msg_1.envid)
124. 77.980 1,015.290 ↑ 1.0 68,114 1

Hash Join (cost=4,657.67..33,353.26 rows=68,114 width=133) (actual time=96.372..1,015.290 rows=68,114 loops=1)

  • Hash Cond: (m_1.contractdpid = cdp_1.contractdpid)
125. 499.201 881.109 ↑ 1.0 68,114 1

Hash Right Join (cost=2,605.57..30,024.02 rows=68,114 width=57) (actual time=40.153..881.109 rows=68,114 loops=1)

  • Hash Cond: (t_1.msgid = m_1.txref)
126. 342.619 342.619 ↑ 1.0 564,873 1

Seq Scan on transaction t_1 (cost=0.00..19,731.73 rows=564,873 width=47) (actual time=0.003..342.619 rows=564,873 loops=1)

127. 17.653 39.289 ↑ 1.0 68,114 1

Hash (cost=1,754.14..1,754.14 rows=68,114 width=18) (actual time=39.289..39.289 rows=68,114 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 3,438kB
128. 21.636 21.636 ↑ 1.0 68,114 1

Seq Scan on metering m_1 (cost=0.00..1,754.14 rows=68,114 width=18) (actual time=0.007..21.636 rows=68,114 loops=1)

129. 5.689 56.201 ↑ 1.0 10,619 1

Hash (cost=1,919.37..1,919.37 rows=10,619 width=80) (actual time=56.201..56.201 rows=10,619 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 995kB
130. 4.802 50.512 ↑ 1.0 10,619 1

Hash Left Join (cost=592.74..1,919.37 rows=10,619 width=80) (actual time=14.597..50.512 rows=10,619 loops=1)

  • Hash Cond: (contract_1.supplierid = s_1.supplierid)
131. 7.613 45.686 ↑ 1.0 10,619 1

Hash Join (cost=591.70..1,772.31 rows=10,619 width=52) (actual time=14.559..45.686 rows=10,619 loops=1)

  • Hash Cond: (cdp_1.contractid = contract_1.contractid)
132. 7.555 23.768 ↑ 1.0 10,619 1

Merge Join (cost=0.61..982.12 rows=10,619 width=48) (actual time=0.028..23.768 rows=10,619 loops=1)

  • Merge Cond: (dp_1.pointid = cdp_1.pointid)
133. 5.882 5.882 ↑ 1.0 8,487 1

Index Scan using deliverypoint_pkey on deliverypoint dp_1 (cost=0.29..290.59 rows=8,487 width=27) (actual time=0.013..5.882 rows=8,487 loops=1)

134. 10.331 10.331 ↑ 1.0 10,619 1

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal cdp_1 (cost=0.29..537.57 rows=10,619 width=25) (actual time=0.008..10.331 rows=10,619 loops=1)

135. 3.921 14.305 ↑ 1.0 10,404 1

Hash (cost=461.04..461.04 rows=10,404 width=8) (actual time=14.305..14.305 rows=10,404 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 407kB
136. 10.384 10.384 ↑ 1.0 10,404 1

Seq Scan on contract contract_1 (cost=0.00..461.04 rows=10,404 width=8) (actual time=0.109..10.384 rows=10,404 loops=1)

137. 0.003 0.024 ↑ 1.0 2 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
138. 0.021 0.021 ↑ 1.0 2 1

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

139. 71.255 227.539 ↑ 1.0 194,940 1

Hash (cost=6,743.40..6,743.40 rows=194,940 width=21) (actual time=227.539..227.539 rows=194,940 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 10,849kB
140. 156.284 156.284 ↑ 1.0 194,940 1

Seq Scan on msgenv msg_1 (cost=0.00..6,743.40 rows=194,940 width=21) (actual time=0.020..156.284 rows=194,940 loops=1)

141. 0.182 0.794 ↓ 5.5 1,096 1

Hash (cost=43.60..43.60 rows=200 width=4) (actual time=0.794..0.794 rows=1,096 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 39kB
142. 0.486 0.612 ↓ 5.5 1,096 1

HashAggregate (cost=41.60..43.60 rows=200 width=4) (actual time=0.458..0.612 rows=1,096 loops=1)

  • Group Key: previousmet.meteringid
143. 0.126 0.126 ↑ 1.7 1,096 1

CTE Scan on previousmet (cost=0.00..36.98 rows=1,849 width=4) (actual time=0.001..0.126 rows=1,096 loops=1)

144. 0.000 8.184 ↑ 1.0 1 2,728

Index Scan using dpj_un on dpconfigjournal dpc_1 (cost=7.98..8.04 rows=1 width=6) (actual time=0.002..0.003 rows=1 loops=2,728)

  • Index Cond: (dpconfigjid = (SubPlan 4))
145.          

SubPlan (for Index Scan)

146. 2.728 90.024 ↑ 1.0 1 2,728

Limit (cost=7.69..7.70 rows=1 width=26) (actual time=0.033..0.033 rows=1 loops=2,728)

147. 13.640 87.296 ↑ 1.0 1 2,728

Sort (cost=7.69..7.70 rows=1 width=26) (actual time=0.032..0.032 rows=1 loops=2,728)

  • Sort Key: ((tx.msgdate)::date), ((j_1.creationdate)::date), j_1.fromdate, j_1.powerlimiter, m_3.budgetmeter
  • Sort Method: quicksort Memory: 25kB
148. 8.638 73.656 ↓ 3.0 3 2,728

Nested Loop Left Join (cost=0.99..7.68 rows=1 width=26) (actual time=0.013..0.027 rows=3 loops=2,728)

149. 2.424 46.376 ↓ 2.0 2 2,728

Nested Loop Left Join (cost=0.71..5.37 rows=1 width=29) (actual time=0.009..0.017 rows=2 loops=2,728)

150. 19.096 19.096 ↓ 2.0 2 2,728

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_1 (cost=0.29..2.91 rows=1 width=25) (actual time=0.004..0.007 rows=2 loops=2,728)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: ((fromdate <= i_1.indexdate) AND ((source)::text = 'DGO'::text))
  • Rows Removed by Filter: 1
151. 24.856 24.856 ↑ 1.0 1 6,214

Index Scan using idx_transaction_msgid_pk on transaction tx (cost=0.42..2.44 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=6,214)

  • Index Cond: (msgid = j_1.txref)
152. 18.642 18.642 ↑ 1.0 1 6,214

Index Scan using idx_meter_physicalconfigid_pk on meter m_3 (cost=0.29..2.30 rows=1 width=5) (actual time=0.002..0.003 rows=1 loops=6,214)

  • Index Cond: (j_1.physicalconfigid = physicalconfigid)
153. 2.728 90.024 ↑ 1.0 1 2,728

Limit (cost=7.69..7.70 rows=1 width=26) (actual time=0.033..0.033 rows=1 loops=2,728)

154. 13.640 87.296 ↑ 1.0 1 2,728

Sort (cost=7.69..7.70 rows=1 width=26) (actual time=0.032..0.032 rows=1 loops=2,728)

  • Sort Key: ((tx.msgdate)::date), ((j_1.creationdate)::date), j_1.fromdate, j_1.powerlimiter, m_3.budgetmeter
  • Sort Method: quicksort Memory: 25kB
155. 8.638 73.656 ↓ 3.0 3 2,728

Nested Loop Left Join (cost=0.99..7.68 rows=1 width=26) (actual time=0.013..0.027 rows=3 loops=2,728)

156. 2.424 46.376 ↓ 2.0 2 2,728

Nested Loop Left Join (cost=0.71..5.37 rows=1 width=29) (actual time=0.009..0.017 rows=2 loops=2,728)

157. 19.096 19.096 ↓ 2.0 2 2,728

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_1 (cost=0.29..2.91 rows=1 width=25) (actual time=0.004..0.007 rows=2 loops=2,728)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: ((fromdate <= i_1.indexdate) AND ((source)::text = 'DGO'::text))
  • Rows Removed by Filter: 1
158. 24.856 24.856 ↑ 1.0 1 6,214

Index Scan using idx_transaction_msgid_pk on transaction tx (cost=0.42..2.44 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=6,214)

  • Index Cond: (msgid = j_1.txref)
159. 18.642 18.642 ↑ 1.0 1 6,214

Index Scan using idx_meter_physicalconfigid_pk on meter m_3 (cost=0.29..2.30 rows=1 width=5) (actual time=0.002..0.003 rows=1 loops=6,214)

  • Index Cond: (j_1.physicalconfigid = physicalconfigid)
160. 0.000 8.184 ↑ 1.0 1 2,728

Index Scan using dpj_un on dpconfigjournal dpc2_1 (cost=15.53..15.59 rows=1 width=6) (actual time=0.002..0.003 rows=1 loops=2,728)

  • Index Cond: (dpconfigjid = (SubPlan 6))
161.          

SubPlan (for Index Scan)

162. 0.000 100.936 ↑ 1.0 1 2,728

Limit (cost=15.24..15.25 rows=1 width=26) (actual time=0.037..0.037 rows=1 loops=2,728)

163.          

Initplan (for Limit)

164. 2.728 46.376 ↑ 1.0 1 2,728

Aggregate (cost=7.54..7.55 rows=1 width=4) (actual time=0.017..0.017 rows=1 loops=2,728)

165. 10.810 43.648 ↓ 2.0 4 2,728

Nested Loop Left Join (cost=0.57..7.53 rows=2 width=4) (actual time=0.005..0.016 rows=4 loops=2,728)

166. 13.640 13.640 ↓ 2.0 4 2,728

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j1 (cost=0.29..2.91 rows=2 width=12) (actual time=0.002..0.005 rows=4 loops=2,728)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: ((source)::text = 'DGO'::text)
167. 19.198 19.198 ↑ 1.0 1 9,599

Index Only Scan using idx_meter_physicalconfigid_pk on meter m1 (cost=0.29..2.30 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=9,599)

  • Index Cond: (physicalconfigid = j1.physicalconfigid)
  • Heap Fetches: 10,919
168. 8.184 98.208 ↑ 1.0 1 2,728

Sort (cost=7.69..7.70 rows=1 width=26) (actual time=0.036..0.036 rows=1 loops=2,728)

  • Sort Key: ((tx_1.msgdate)::date), ((j_2.creationdate)::date), j_2.powerlimiter, m_4.budgetmeter
  • Sort Method: quicksort Memory: 25kB
169. 6.840 90.024 ↑ 1.0 1 2,728

Nested Loop Left Join (cost=0.99..7.68 rows=1 width=26) (actual time=0.028..0.033 rows=1 loops=2,728)

170. 3.440 76.384 ↑ 1.0 1 2,728

Nested Loop Left Join (cost=0.71..5.37 rows=1 width=29) (actual time=0.025..0.028 rows=1 loops=2,728)

171. 62.744 62.744 ↑ 1.0 1 2,728

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_2 (cost=0.29..2.91 rows=1 width=25) (actual time=0.021..0.023 rows=1 loops=2,728)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: (((source)::text = 'DGO'::text) AND (fromdate = $10))
  • Rows Removed by Filter: 2
172. 10.200 10.200 ↑ 1.0 1 3,400

Index Scan using idx_transaction_msgid_pk on transaction tx_1 (cost=0.42..2.44 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=3,400)

  • Index Cond: (msgid = j_2.txref)
173. 6.800 6.800 ↑ 1.0 1 3,400

Index Scan using idx_meter_physicalconfigid_pk on meter m_4 (cost=0.29..2.30 rows=1 width=5) (actual time=0.002..0.002 rows=1 loops=3,400)

  • Index Cond: (j_2.physicalconfigid = physicalconfigid)
174. 0.000 100.936 ↑ 1.0 1 2,728

Limit (cost=15.24..15.25 rows=1 width=26) (actual time=0.037..0.037 rows=1 loops=2,728)

175.          

Initplan (for Limit)

176. 2.728 46.376 ↑ 1.0 1 2,728

Aggregate (cost=7.54..7.55 rows=1 width=4) (actual time=0.017..0.017 rows=1 loops=2,728)

177. 10.810 43.648 ↓ 2.0 4 2,728

Nested Loop Left Join (cost=0.57..7.53 rows=2 width=4) (actual time=0.005..0.016 rows=4 loops=2,728)

178. 13.640 13.640 ↓ 2.0 4 2,728

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j1 (cost=0.29..2.91 rows=2 width=12) (actual time=0.002..0.005 rows=4 loops=2,728)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: ((source)::text = 'DGO'::text)
179. 19.198 19.198 ↑ 1.0 1 9,599

Index Only Scan using idx_meter_physicalconfigid_pk on meter m1 (cost=0.29..2.30 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=9,599)

  • Index Cond: (physicalconfigid = j1.physicalconfigid)
  • Heap Fetches: 10,919
180. 8.184 98.208 ↑ 1.0 1 2,728

Sort (cost=7.69..7.70 rows=1 width=26) (actual time=0.036..0.036 rows=1 loops=2,728)

  • Sort Key: ((tx_1.msgdate)::date), ((j_2.creationdate)::date), j_2.powerlimiter, m_4.budgetmeter
  • Sort Method: quicksort Memory: 25kB
181. 6.840 90.024 ↑ 1.0 1 2,728

Nested Loop Left Join (cost=0.99..7.68 rows=1 width=26) (actual time=0.028..0.033 rows=1 loops=2,728)

182. 3.440 76.384 ↑ 1.0 1 2,728

Nested Loop Left Join (cost=0.71..5.37 rows=1 width=29) (actual time=0.025..0.028 rows=1 loops=2,728)

183. 62.744 62.744 ↑ 1.0 1 2,728

Index Scan using idx_dpconfigjournal_pointid_pk on dpconfigjournal j_2 (cost=0.29..2.91 rows=1 width=25) (actual time=0.021..0.023 rows=1 loops=2,728)

  • Index Cond: (pointid = dp_1.pointid)
  • Filter: (((source)::text = 'DGO'::text) AND (fromdate = $10))
  • Rows Removed by Filter: 2
184. 10.200 10.200 ↑ 1.0 1 3,400

Index Scan using idx_transaction_msgid_pk on transaction tx_1 (cost=0.42..2.44 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=3,400)

  • Index Cond: (msgid = j_2.txref)
185. 6.800 6.800 ↑ 1.0 1 3,400

Index Scan using idx_meter_physicalconfigid_pk on meter m_4 (cost=0.29..2.30 rows=1 width=5) (actual time=0.002..0.002 rows=1 loops=3,400)

  • Index Cond: (j_2.physicalconfigid = physicalconfigid)
186. 13.640 13.640 ↓ 0.0 0 2,728

Index Scan using idx_index_meteringid on index i2_1 (cost=0.29..0.38 rows=1 width=19) (actual time=0.005..0.005 rows=0 loops=2,728)

  • Index Cond: (i_1.meteringid = meteringid)
  • Filter: ((i_1.meterid <> meterid) AND ((i_1.timeframe)::text = (timeframe)::text) AND ((i_1.unit)::text = (unit)::text) AND ((i_1.type)::text = (type)::text))
  • Rows Removed by Filter: 4
187.          

SubPlan (for Nested Loop Left Join)

188. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..8.64 rows=6 width=0) (never executed)

189. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal cdp_3 (cost=0.29..2.30 rows=1 width=4) (never executed)

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

Index Only Scan using process_idx4test on process p (cost=0.29..6.27 rows=7 width=4) (never executed)

  • Index Cond: (contractdpid = cdp_3.contractdpid)
  • Heap Fetches: 0
191. 32.384 47.320 ↑ 1.0 61,691 1

Hash Join (cost=546.93..3,359.54 rows=61,691 width=4) (actual time=4.873..47.320 rows=61,691 loops=1)

  • Hash Cond: (p_1.contractdpid = cdp_4.contractdpid)
192. 10.081 10.081 ↑ 1.0 61,691 1

Seq Scan on process p_1 (cost=0.00..1,655.91 rows=61,691 width=4) (actual time=0.006..10.081 rows=61,691 loops=1)

193. 2.190 4.855 ↑ 1.0 10,619 1

Hash (cost=414.19..414.19 rows=10,619 width=8) (actual time=4.855..4.855 rows=10,619 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 415kB
194. 2.665 2.665 ↑ 1.0 10,619 1

Seq Scan on contractdpjournal cdp_4 (cost=0.00..414.19 rows=10,619 width=8) (actual time=0.005..2.665 rows=10,619 loops=1)

195. 5.954 196.118 ↓ 1.0 12,768 1

Subquery Scan on *SELECT* 3 (cost=2,052.11..3,701.75 rows=12,704 width=106) (actual time=92.810..196.118 rows=12,768 loops=1)

196. 89.458 190.164 ↓ 1.0 12,768 1

Hash Join (cost=2,052.11..3,574.71 rows=12,704 width=106) (actual time=92.807..190.164 rows=12,768 loops=1)

  • Hash Cond: (i_2.contractdpid = cdp_2.contractdpid)
197. 8.027 8.027 ↓ 1.0 12,768 1

Seq Scan on userindex i_2 (cost=0.00..331.60 rows=12,704 width=42) (actual time=0.065..8.027 rows=12,768 loops=1)

  • Filter: ((indexdate IS NULL) OR (indexdate <= '9999-12-31 00:00:00+01'::timestamp with time zone))
198. 8.397 92.679 ↑ 1.0 10,619 1

Hash (cost=1,919.37..1,919.37 rows=10,619 width=68) (actual time=92.679..92.679 rows=10,619 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 839kB
199. 5.745 84.282 ↑ 1.0 10,619 1

Hash Left Join (cost=592.74..1,919.37 rows=10,619 width=68) (actual time=5.333..84.282 rows=10,619 loops=1)

  • Hash Cond: (contract_2.supplierid = s_2.supplierid)
200. 10.794 78.530 ↑ 1.0 10,619 1

Hash Join (cost=591.70..1,772.31 rows=10,619 width=40) (actual time=5.316..78.530 rows=10,619 loops=1)

  • Hash Cond: (cdp_2.contractid = contract_2.contractid)
201. 11.094 62.468 ↑ 1.0 10,619 1

Merge Join (cost=0.61..982.12 rows=10,619 width=36) (actual time=0.024..62.468 rows=10,619 loops=1)

  • Merge Cond: (dp_2.pointid = cdp_2.pointid)
202. 16.972 16.972 ↑ 1.0 8,487 1

Index Scan using deliverypoint_pkey on deliverypoint dp_2 (cost=0.29..290.59 rows=8,487 width=24) (actual time=0.011..16.972 rows=8,487 loops=1)

203. 34.402 34.402 ↑ 1.0 10,619 1

Index Scan using idx_contractdpjournal_pointid_pk on contractdpjournal cdp_2 (cost=0.29..537.57 rows=10,619 width=20) (actual time=0.007..34.402 rows=10,619 loops=1)

204. 2.233 5.268 ↑ 1.0 10,404 1

Hash (cost=461.04..461.04 rows=10,404 width=8) (actual time=5.268..5.268 rows=10,404 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 407kB
205. 3.035 3.035 ↑ 1.0 10,404 1

Seq Scan on contract contract_2 (cost=0.00..461.04 rows=10,404 width=8) (actual time=0.012..3.035 rows=10,404 loops=1)

206. 0.001 0.007 ↑ 1.0 2 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
207. 0.006 0.006 ↑ 1.0 2 1

Seq Scan on supplier s_2 (cost=0.00..1.02 rows=2 width=36) (actual time=0.004..0.006 rows=2 loops=1)