explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VMvT

Settings
# exclusive inclusive rows x rows loops node
1. 74,529.081 74,529.081 ↓ 849.0 849 1

CTE Scan on src_side (cost=6,122,146.33..6,122,146.35 rows=1 width=544) (actual time=8,864.130..74,529.081 rows=849 loops=1)

2.          

CTE all_src_intervals

3. 447.899 6,063.169 ↓ 1.5 349,657 1

Recursive Union (cost=1,000.42..4,619,407.62 rows=235,000 width=56) (actual time=1.286..6,063.169 rows=349,657 loops=1)

4. 0.000 509.741 ↑ 1.2 191,939 1

Gather (cost=1,000.42..173,472.85 rows=233,640 width=41) (actual time=1.282..509.741 rows=191,939 loops=1)

  • Workers Planned: 5
  • Workers Launched: 5
5. 53.162 706.679 ↑ 1.5 31,990 6 / 6

Nested Loop Anti Join (cost=0.42..149,108.85 rows=46,728 width=41) (actual time=0.512..706.679 rows=31,990 loops=6)

6. 70.755 70.755 ↑ 1.2 58,276 6 / 6

Parallel Seq Scan on bag_panden s (cost=0.00..95,109.31 rows=69,931 width=37) (actual time=0.018..70.755 rows=58,276 loops=6)

7. 582.762 582.762 ↓ 0.0 0 349,657 / 6

Index Scan using bag_panden__id_volgnummer_key on bag_panden t (cost=0.42..0.76 rows=1 width=29) (actual time=0.010..0.010 rows=0 loops=349,657)

  • Index Cond: (((s._id)::text = (_id)::text) AND (volgnummer < s.volgnummer))
  • Filter: (eind_geldigheid = s.begin_geldigheid)
  • Rows Removed by Filter: 0
8. 1,075.261 5,105.529 ↓ 574.0 78,060 11

Merge Join (cost=423,972.96..444,123.48 rows=136 width=56) (actual time=366.072..464.139 rows=78,060 loops=11)

  • Merge Cond: ((intv.eind_geldigheid = src.begin_geldigheid) AND ((intv._id)::text = (src._id)::text))
  • Join Filter: (src.volgnummer > intv.volgnummer)
  • Rows Removed by Join Filter: 66,621
9. 1,463.132 1,505.009 ↑ 162.9 14,339 11

Sort (cost=293,870.71..299,711.71 rows=2,336,400 width=56) (actual time=134.597..136.819 rows=14,339 loops=11)

  • Sort Key: intv.eind_geldigheid, intv._id
  • Sort Method: quicksort Memory: 25kB
10. 41.877 41.877 ↑ 73.5 31,787 11

WorkTable Scan on all_src_intervals intv (cost=0.00..46,728.00 rows=2,336,400 width=56) (actual time=0.002..3.807 rows=31,787 loops=11)

11. 2,250.446 2,525.259 ↓ 1.3 469,419 11

Sort (cost=130,102.25..130,976.40 rows=349,657 width=37) (actual time=175.848..229.569 rows=469,419 loops=11)

  • Sort Key: src.begin_geldigheid, src._id
  • Sort Method: quicksort Memory: 39,605kB
12. 274.813 274.813 ↑ 1.0 349,657 1

Seq Scan on bag_panden src (cost=0.00..97,906.57 rows=349,657 width=37) (actual time=0.018..274.813 rows=349,657 loops=1)

  • Filter: (begin_geldigheid IS NOT NULL)
13.          

CTE all_dst_intervals

14. 229.226 1,128.704 ↓ 1.4 361,928 1

Recursive Union (cost=33,012.20..1,443,845.11 rows=254,332 width=56) (actual time=220.460..1,128.704 rows=361,928 loops=1)

15. 217.578 497.598 ↑ 1.3 184,537 1

Hash Anti Join (cost=33,012.20..67,575.72 rows=244,872 width=30) (actual time=220.457..497.598 rows=184,537 loops=1)

  • Hash Cond: (((s_1._id)::text = (t_1._id)::text) AND (s_1.begin_geldigheid = t_1.eind_geldigheid))
  • Join Filter: (t_1.volgnummer < s_1.volgnummer)
  • Rows Removed by Join Filter: 11,814
16. 60.184 60.184 ↑ 1.0 361,928 1

Seq Scan on bag_onderzoeken s_1 (cost=0.00..27,583.28 rows=361,928 width=26) (actual time=0.007..60.184 rows=361,928 loops=1)

17. 72.966 219.836 ↑ 2.0 177,396 1

Hash (cost=27,583.28..27,583.28 rows=361,928 width=18) (actual time=219.836..219.836 rows=177,396 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 13,791kB
18. 146.870 146.870 ↑ 1.0 361,928 1

Seq Scan on bag_onderzoeken t_1 (cost=0.00..27,583.28 rows=361,928 width=18) (actual time=0.003..146.870 rows=361,928 loops=1)

19. 130.124 401.880 ↓ 37.6 35,533 5

Hash Join (cost=33,012.20..137,118.28 rows=946 width=56) (actual time=46.633..80.376 rows=35,533 loops=5)

  • Hash Cond: ((intv_1.eind_geldigheid = dst.begin_geldigheid) AND ((intv_1._id)::text = (dst._id)::text))
  • Join Filter: (dst.volgnummer > intv_1.volgnummer)
  • Rows Removed by Join Filter: 2,370
20. 41.170 41.170 ↑ 33.8 72,386 5

WorkTable Scan on all_dst_intervals intv_1 (cost=0.00..48,974.40 rows=2,448,720 width=56) (actual time=0.001..8.234 rows=72,386 loops=5)

21. 98.724 230.586 ↑ 1.0 361,928 1

Hash (cost=27,583.28..27,583.28 rows=361,928 width=26) (actual time=230.586..230.586 rows=361,928 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 24,711kB
22. 131.862 131.862 ↑ 1.0 361,928 1

Seq Scan on bag_onderzoeken dst (cost=0.00..27,583.28 rows=361,928 width=26) (actual time=0.011..131.862 rows=361,928 loops=1)

  • Filter: (begin_geldigheid IS NOT NULL)
23.          

CTE src_entities

24. 0.977 9.310 ↑ 1.0 10,000 1

Limit (cost=0.00..2,800.07 rows=10,000 width=816) (actual time=0.021..9.310 rows=10,000 loops=1)

25. 8.333 8.333 ↑ 35.0 10,000 1

Seq Scan on bag_panden src_1 (cost=0.00..97,906.57 rows=349,657 width=816) (actual time=0.019..8.333 rows=10,000 loops=1)

26.          

CTE src_volgnummer_begin_geldigheid

27. 9.255 6,314.029 ↑ 2.4 10,000 1

HashAggregate (cost=7,369.06..7,604.06 rows=23,500 width=44) (actual time=6,309.291..6,314.029 rows=10,000 loops=1)

  • Group Key: all_src_intervals._id, all_src_intervals.volgnummer
28. 105.624 6,304.774 ↑ 5.9 10,000 1

Hash Join (cost=275.00..6,928.44 rows=58,750 width=44) (actual time=11.619..6,304.774 rows=10,000 loops=1)

  • Hash Cond: (((all_src_intervals._id)::text = (src_entities._id)::text) AND (all_src_intervals.volgnummer = src_entities.volgnummer))
29. 6,188.834 6,188.834 ↓ 1.5 349,657 1

CTE Scan on all_src_intervals (cost=0.00..4,700.00 rows=235,000 width=44) (actual time=1.288..6,188.834 rows=349,657 loops=1)

30. 1.998 10.316 ↓ 10.0 10,000 1

Hash (cost=260.00..260.00 rows=1,000 width=36) (actual time=10.316..10.316 rows=10,000 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 675kB
31. 5.398 8.318 ↓ 10.0 10,000 1

HashAggregate (cost=250.00..260.00 rows=1,000 width=36) (actual time=6.428..8.318 rows=10,000 loops=1)

  • Group Key: (src_entities._id)::text, src_entities.volgnummer
32. 2.920 2.920 ↑ 1.0 10,000 1

CTE Scan on src_entities (cost=0.00..200.00 rows=10,000 width=36) (actual time=0.002..2.920 rows=10,000 loops=1)

33.          

CTE dst_entities

34. 56.953 56.953 ↑ 1.0 361,928 1

Seq Scan on bag_onderzoeken (cost=0.00..27,583.28 rows=361,928 width=218) (actual time=0.006..56.953 rows=361,928 loops=1)

35.          

CTE dst_volgnummer_begin_geldigheid

36. 274.427 2,294.886 ↓ 14.2 361,928 1

HashAggregate (cost=17,630.67..17,885.00 rows=25,433 width=44) (actual time=2,198.492..2,294.886 rows=361,928 loops=1)

  • Group Key: all_dst_intervals._id, all_dst_intervals.volgnummer
37. 214.062 2,020.459 ↓ 5.7 361,928 1

Hash Join (cost=9,953.03..17,153.80 rows=63,583 width=44) (actual time=781.845..2,020.459 rows=361,928 loops=1)

  • Hash Cond: (((all_dst_intervals._id)::text = (dst_entities._id)::text) AND (all_dst_intervals.volgnummer = dst_entities.volgnummer))
38. 1,245.119 1,245.119 ↓ 1.4 361,928 1

CTE Scan on all_dst_intervals (cost=0.00..5,086.64 rows=254,332 width=44) (actual time=220.462..1,245.119 rows=361,928 loops=1)

39. 76.938 561.278 ↓ 10.0 361,928 1

Hash (cost=9,410.13..9,410.13 rows=36,193 width=36) (actual time=561.278..561.278 rows=361,928 loops=1)

  • Buckets: 524,288 (originally 65536) Batches: 1 (originally 1) Memory Usage: 19,641kB
40. 244.878 484.340 ↓ 10.0 361,928 1

HashAggregate (cost=9,048.20..9,410.13 rows=36,193 width=36) (actual time=393.114..484.340 rows=361,928 loops=1)

  • Group Key: (dst_entities._id)::text, dst_entities.volgnummer
41. 239.462 239.462 ↑ 1.0 361,928 1

CTE Scan on dst_entities (cost=0.00..7,238.56 rows=361,928 width=36) (actual time=0.009..239.462 rows=361,928 loops=1)

42.          

CTE max_src_event

43. 0.002 0.030 ↑ 1.0 1 1

Result (cost=0.47..0.48 rows=1 width=4) (actual time=0.030..0.030 rows=1 loops=1)

44.          

Initplan (for Result)

45. 0.002 0.028 ↑ 1.0 1 1

Limit (cost=0.42..0.47 rows=1 width=4) (actual time=0.027..0.028 rows=1 loops=1)

46. 0.026 0.026 ↑ 349,657.0 1 1

Index Only Scan Backward using bag_pnd_613273a0ec2090693894cea102aa8c06 on bag_panden (cost=0.42..15,917.83 rows=349,657 width=4) (actual time=0.025..0.026 rows=1 loops=1)

  • Index Cond: (_last_event IS NOT NULL)
  • Heap Fetches: 1
47.          

CTE max_dst_event

48. 0.001 0.017 ↑ 1.0 1 1

Result (cost=0.45..0.46 rows=1 width=4) (actual time=0.017..0.017 rows=1 loops=1)

49.          

Initplan (for Result)

50. 0.001 0.016 ↑ 1.0 1 1

Limit (cost=0.42..0.45 rows=1 width=4) (actual time=0.015..0.016 rows=1 loops=1)

51. 0.015 0.015 ↑ 361,928.0 1 1

Index Only Scan Backward using bag_ozk_613273a0ec2090693894cea102aa8c06 on bag_onderzoeken bag_onderzoeken_1 (cost=0.42..9,548.36 rows=361,928 width=4) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: (_last_event IS NOT NULL)
  • Heap Fetches: 0
52.          

CTE src_side

53. 10.232 74,525.485 ↓ 849.0 849 1

Nested Loop (cost=1,649.37..3,020.25 rows=1 width=492) (actual time=8,864.126..74,525.485 rows=849 loops=1)

54. 1.494 74,515.253 ↓ 849.0 849 1

Nested Loop (cost=1,649.37..3,020.13 rows=1 width=384) (actual time=8,864.093..74,515.253 rows=849 loops=1)

55. 3.311 74,512.910 ↓ 849.0 849 1

Nested Loop Left Join (cost=1,649.37..3,020.10 rows=1 width=380) (actual time=8,864.059..74,512.910 rows=849 loops=1)

  • Join Filter: (((src_2._application)::text = 'Neuron'::text) AND ((rel_bag_pnd_bag_ozk_heeft_onderzoeken.src_id)::text = (src_2._id)::text) AND (rel_bag_pnd_bag_ozk_heeft_onderzoeken.src_volgnummer = src_2.volgnummer) AND ((json_arr_elm.item ->> 'bronwaarde'::text) = (rel_bag_pnd_bag_ozk_heeft_onderzoeken.bronwaarde)::text))
  • Filter: ((rel_bag_pnd_bag_ozk_heeft_onderzoeken._date_deleted IS NULL) OR (src_2._id IS NOT NULL))
56. 12.256 74,499.411 ↓ 849.0 849 1

Nested Loop (cost=1,399.22..2,744.91 rows=1 width=244) (actual time=8,864.022..74,499.411 rows=849 loops=1)

57. 12.310 6,558.341 ↓ 10,566.0 10,566 1

Hash Right Join (cost=1,394.40..2,040.66 rows=1 width=246) (actual time=6,535.935..6,558.341 rows=10,566 loops=1)

  • Hash Cond: (((src_bg._id)::text = (src_2._id)::text) AND (src_bg.volgnummer = src_2.volgnummer))
58. 6,319.419 6,319.419 ↑ 2.4 10,000 1

CTE Scan on src_volgnummer_begin_geldigheid src_bg (cost=0.00..470.00 rows=23,500 width=44) (actual time=6,309.294..6,319.419 rows=10,000 loops=1)

59. 4.373 226.612 ↓ 10,566.0 10,566 1

Hash (cost=1,394.39..1,394.39 rows=1 width=238) (actual time=226.612..226.612 rows=10,566 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1,808kB
60. 8.471 222.239 ↓ 10,566.0 10,566 1

Merge Join (cost=1,181.44..1,394.39 rows=1 width=238) (actual time=203.715..222.239 rows=10,566 loops=1)

  • Merge Cond: (((src_entities_2._id)::text = (src_2._id)::text) AND (src_entities_2.volgnummer = src_2.volgnummer))
  • Join Filter: ((src_2._source)::text = (src_entities_2._source)::text)
61. 7.155 173.614 ↓ 2.1 10,566 1

WindowAgg (cost=955.03..1,092.53 rows=5,000 width=118) (actual time=164.803..173.614 rows=10,566 loops=1)

62. 39.080 166.459 ↓ 2.1 10,566 1

Sort (cost=955.03..967.53 rows=5,000 width=110) (actual time=164.789..166.459 rows=10,566 loops=1)

  • Sort Key: src_entities_2._id, src_entities_2.volgnummer, ((json_arr_elm_1.item ->> 'bronwaarde'::text))
  • Sort Method: quicksort Memory: 1,263kB
63. 9.440 127.379 ↓ 2.1 10,566 1

HashAggregate (cost=585.33..647.83 rows=5,000 width=110) (actual time=124.374..127.379 rows=10,566 loops=1)

  • Group Key: src_entities_2._id, dst_2._id, (json_arr_elm_1.item ->> 'bronwaarde'::text), src_entities_2._source, src_entities_2.volgnummer
64. 5.817 117.939 ↓ 2.1 10,566 1

Nested Loop (cost=0.42..510.33 rows=5,000 width=110) (actual time=0.081..117.939 rows=10,566 loops=1)

65. 1.714 101.556 ↓ 211.3 10,566 1

Nested Loop Left Join (cost=0.42..385.33 rows=50 width=110) (actual time=0.064..101.556 rows=10,566 loops=1)

  • Join Filter: ((src_entities_2._application)::text = 'Neuron'::text)
66. 29.842 29.842 ↓ 200.0 10,000 1

CTE Scan on src_entities src_entities_2 (cost=0.00..200.00 rows=50 width=172) (actual time=0.026..29.842 rows=10,000 loops=1)

  • Filter: (_date_deleted IS NULL)
67. 70.000 70.000 ↓ 0.0 0 10,000

Index Scan using bag_ozk_2c5e9e3edb055efb9ce5e2a9588c46f6 on bag_onderzoeken dst_2 (cost=0.42..3.68 rows=2 width=43) (actual time=0.006..0.007 rows=0 loops=10,000)

  • Index Cond: ((object_identificatie)::text = (src_entities_2.identificatie)::text)
  • Filter: ((_date_deleted IS NULL) AND ((begin_geldigheid < src_entities_2.eind_geldigheid) OR (src_entities_2.eind_geldigheid IS NULL)) AND ((eind_geldigheid >= src_entities_2.eind_geldigheid) OR (eind_geldigheid IS NULL)))
  • Rows Removed by Filter: 0
68. 10.566 10.566 ↑ 100.0 1 10,566

Function Scan on jsonb_array_elements json_arr_elm_1 (cost=0.00..1.25 rows=100 width=32) (actual time=0.001..0.001 rows=1 loops=10,566)

  • Filter: ((item ->> 'bronwaarde'::text) IS NOT NULL)
69. 36.038 40.154 ↓ 211.3 10,566 1

Sort (cost=226.41..226.54 rows=50 width=188) (actual time=38.902..40.154 rows=10,566 loops=1)

  • Sort Key: src_2._id, src_2.volgnummer
  • Sort Method: quicksort Memory: 1,791kB
70. 4.116 4.116 ↓ 200.0 10,000 1

CTE Scan on src_entities src_2 (cost=0.00..225.00 rows=50 width=188) (actual time=0.004..4.116 rows=10,000 loops=1)

  • Filter: ((_application)::text = 'Neuron'::text)
71. 36,067.728 67,928.814 ↓ 0.0 0 10,566

Hash Right Join (cost=4.82..704.23 rows=1 width=72) (actual time=3.178..6.429 rows=0 loops=10,566)

  • Hash Cond: (((dst_bg._id)::text = (dst_1._id)::text) AND (dst_bg.volgnummer = dst_1.volgnummer))
72. 31,818.822 31,818.822 ↓ 14.2 361,928 849

CTE Scan on dst_volgnummer_begin_geldigheid dst_bg (cost=0.00..508.66 rows=25,433 width=44) (actual time=2.590..37.478 rows=361,928 loops=849)

73. 0.000 42.264 ↓ 0.0 0 10,566

Hash (cost=4.80..4.80 rows=1 width=64) (actual time=0.004..0.004 rows=0 loops=10,566)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
74. 12.642 42.264 ↓ 0.0 0 10,566

Nested Loop (cost=0.42..4.80 rows=1 width=64) (actual time=0.004..0.004 rows=0 loops=10,566)

  • Join Filter: (((json_arr_elm_1.item ->> 'bronwaarde'::text)) = (json_arr_elm.item ->> 'bronwaarde'::text))
75. 21.132 21.132 ↓ 0.0 0 10,566

Index Scan using bag_onderzoeken__id_volgnummer_key on bag_onderzoeken dst_1 (cost=0.42..2.05 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=10,566)

  • Index Cond: (((_id)::text = (dst_2._id)::text) AND (_id IS NOT NULL) AND (volgnummer = (max(dst_2.volgnummer))))
  • Filter: (_date_deleted IS NULL)
76. 8.490 8.490 ↑ 100.0 1 849

Function Scan on jsonb_array_elements json_arr_elm (cost=0.00..1.25 rows=100 width=32) (actual time=0.010..0.010 rows=1 loops=849)

  • Filter: ((item ->> 'bronwaarde'::text) IS NOT NULL)
77. 3.396 10.188 ↓ 0.0 0 849

Nested Loop (cost=250.15..275.17 rows=1 width=204) (actual time=0.012..0.012 rows=0 loops=849)

  • Join Filter: (((rel_bag_pnd_bag_ozk_heeft_onderzoeken.src_id)::text = (src_entities_1._id)::text) AND (rel_bag_pnd_bag_ozk_heeft_onderzoeken.src_volgnummer = src_entities_1.volgnummer))
78. 6.792 6.792 ↓ 0.0 0 849

Index Scan using rel_bag_pnd_bag_ozk_fb10656a_c5625cb292cd152f07c13709330d1712 on rel_bag_pnd_bag_ozk_heeft_onderzoeken (cost=0.14..0.17 rows=1 width=204) (actual time=0.008..0.008 rows=0 loops=849)

  • Index Cond: (((dst_id)::text = (dst_1._id)::text) AND (dst_volgnummer = dst_1.volgnummer))
79. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=250.00..260.00 rows=1,000 width=36) (never executed)

  • Group Key: (src_entities_1._id)::text, src_entities_1.volgnummer
80. 0.000 0.000 ↓ 0.0 0

CTE Scan on src_entities src_entities_1 (cost=0.00..200.00 rows=10,000 width=36) (never executed)

81. 0.849 0.849 ↑ 1.0 1 849

CTE Scan on max_src_event (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=849)

82. 0.000 0.000 ↑ 1.0 1 849

CTE Scan on max_dst_event (cost=0.00..0.02 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=849)

Planning time : 13.290 ms
Execution time : 74,604.094 ms