explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rZEL : 33

Settings
# exclusive inclusive rows x rows loops node
1. 103,286.569 106,554.732 ↓ 11.7 758,103 1

Sort (cost=26,701..26,862.56 rows=64,625 width=2,719) (actual time=105,831.176..106,554.732 rows=758,103 loops=1)

  • Sort Key: a.id, a0.request_id, a0.document_id, a1.approval_request_id, a1.connection_request_id, i.id, i0.id, r.check_id, r.document_id, f0.id, f1.approval_id, f1.document_id, p.id, p0.approval_id, p0.document_id, g0.approval_id, g0.document_id, a3.id, a4.history_id, a4.document_id, a5.id, a5.form_id, a6.activity_group_id, o.id, o0.id, a10.id, r0.id
  • Sort Method: quicksort Memory: 1,657,007kB
  • Buffers: shared hit=571
2. 1,065.669 3,268.163 ↓ 11.7 758,103 1

Hash Join (cost=18,607.87..21,537.53 rows=64,625 width=2,719) (actual time=205.838..3,268.163 rows=758,103 loops=1)

  • Buffers: shared hit=571
3. 1,041.757 2,200.455 ↓ 10.0 769,898 1

Hash Join (cost=2,112.74..4,119.81 rows=76,723 width=2,719) (actual time=203.78..2,200.455 rows=769,898 loops=1)

  • Buffers: shared hit=536
4. 938.532 1,154.071 ↓ 6.2 478,771 1

Hash Join (cost=2,032.3..2,984.43 rows=76,723 width=2,414) (actual time=199.132..1,154.071 rows=478,771 loops=1)

  • Buffers: shared hit=512
5. 16.358 90.885 ↑ 1.8 11,385 1

Hash Join (cost=1,443.55..1,477.23 rows=20,165 width=1,314) (actual time=74.446..90.885 rows=11,385 loops=1)

  • Buffers: shared hit=368
6. 0.278 0.486 ↑ 1.6 269 1

Hash Join (cost=9.05..29.03 rows=420 width=201) (actual time=0.236..0.486 rows=269 loops=1)

  • Buffers: shared hit=3
7. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on report_technical_params r0 (cost=0..14.2 rows=420 width=164) (actual time=0.001..0.001 rows=0 loops=1)

8. 0.123 0.207 ↑ 1.0 269 1

Hash (cost=5.69..5.69 rows=269 width=37) (actual time=0.207..0.207 rows=269 loops=1)

  • Buffers: shared hit=3
9. 0.084 0.084 ↑ 1.0 269 1

Seq Scan on activity_report a10 (cost=0..5.69 rows=269 width=37) (actual time=0.01..0.084 rows=269 loops=1)

  • Buffers: shared hit=3
10. 17.187 74.041 ↑ 1.8 10,977 1

Hash (cost=1,182.43..1,182.43 rows=20,165 width=1,113) (actual time=74.041..74.041 rows=10,977 loops=1)

  • Buffers: shared hit=365
11. 10.841 56.854 ↑ 1.8 10,977 1

Hash Join (cost=576.5..1,182.43 rows=20,165 width=1,113) (actual time=23.906..56.854 rows=10,977 loops=1)

  • Buffers: shared hit=365
12. 8.207 30.321 ↑ 1.0 7,635 1

Hash Join (cost=261.72..766.35 rows=7,647 width=892) (actual time=8.169..30.321 rows=7,635 loops=1)

  • Buffers: shared hit=301
13. 10.351 21.669 ↑ 1.0 7,635 1

Hash Join (cost=248.06..647.54 rows=7,647 width=346) (actual time=7.709..21.669 rows=7,635 loops=1)

  • Buffers: shared hit=293
14. 3.684 3.684 ↑ 1.0 7,710 1

Seq Scan on activity_form a6 (cost=0..294.1 rows=7,710 width=282) (actual time=0.006..3.684 rows=7,710 loops=1)

  • Buffers: shared hit=217
15. 4.089 7.634 ↑ 1.0 7,635 1

Hash (cost=152.47..152.47 rows=7,647 width=64) (actual time=7.634..7.634 rows=7,635 loops=1)

  • Buffers: shared hit=76
16. 3.545 3.545 ↑ 1.0 7,635 1

Seq Scan on activity a5 (cost=0..152.47 rows=7,647 width=64) (actual time=0.015..3.545 rows=7,635 loops=1)

  • Buffers: shared hit=76
17. 0.097 0.445 ↑ 1.0 100 1

Hash (cost=12.41..12.41 rows=100 width=546) (actual time=0.445..0.445 rows=100 loops=1)

  • Buffers: shared hit=8
18. 0.131 0.348 ↑ 1.0 100 1

Hash Join (cost=6.25..12.41 rows=100 width=546) (actual time=0.197..0.348 rows=100 loops=1)

  • Buffers: shared hit=8
19. 0.058 0.058 ↑ 1.0 100 1

Seq Scan on activity_group a7 (cost=0..5 rows=100 width=273) (actual time=0.019..0.058 rows=100 loops=1)

  • Buffers: shared hit=4
20. 0.099 0.159 ↑ 1.0 100 1

Hash (cost=5..5 rows=100 width=273) (actual time=0.159..0.159 rows=100 loops=1)

  • Buffers: shared hit=4
21. 0.060 0.060 ↑ 1.0 100 1

Seq Scan on activity_group a8 (cost=0..5 rows=100 width=273) (actual time=0.003..0.06 rows=100 loops=1)

  • Buffers: shared hit=4
22. 3.679 15.692 ↑ 1.0 5,398 1

Hash (cost=247.3..247.3 rows=5,398 width=221) (actual time=15.692..15.692 rows=5,398 loops=1)

  • Buffers: shared hit=64
23. 6.315 12.013 ↑ 1.0 5,398 1

Hash Join (cost=68.1..247.3 rows=5,398 width=221) (actual time=3.414..12.013 rows=5,398 loops=1)

  • Buffers: shared hit=64
24. 2.301 2.301 ↑ 1.0 5,398 1

Seq Scan on order_cost o0 (cost=0..104.98 rows=5,398 width=41) (actual time=0.006..2.301 rows=5,398 loops=1)

  • Buffers: shared hit=51
25. 1.030 3.397 ↑ 1.0 2,047 1

Hash (cost=42.51..42.51 rows=2,047 width=180) (actual time=3.397..3.397 rows=2,047 loops=1)

  • Buffers: shared hit=13
26. 1.591 2.367 ↑ 1.0 2,047 1

Hash Join (cost=1.94..42.51 rows=2,047 width=180) (actual time=0.077..2.367 rows=2,047 loops=1)

  • Buffers: shared hit=13
27. 0.722 0.722 ↑ 1.0 2,047 1

Seq Scan on activity_order a9 (cost=0..32.47 rows=2,047 width=16) (actual time=0.011..0.722 rows=2,047 loops=1)

  • Buffers: shared hit=12
28. 0.029 0.054 ↑ 1.0 42 1

Hash (cost=1.42..1.42 rows=42 width=164) (actual time=0.054..0.054 rows=42 loops=1)

  • Buffers: shared hit=1
29. 0.025 0.025 ↑ 1.0 42 1

Seq Scan on order_technical_params o (cost=0..1.42 rows=42 width=164) (actual time=0.008..0.025 rows=42 loops=1)

  • Buffers: shared hit=1
30. 56.106 124.654 ↓ 7.5 25,687 1

Hash (cost=545.9..545.9 rows=3,428 width=1,100) (actual time=124.654..124.654 rows=25,687 loops=1)

  • Buffers: shared hit=144
31. 35.473 68.548 ↓ 7.5 25,687 1

Hash Join (cost=438.92..545.9 rows=3,428 width=1,100) (actual time=28.387..68.548 rows=25,687 loops=1)

  • Buffers: shared hit=144
32. 3.939 8.840 ↓ 1.1 3,672 1

Hash Join (cost=128.92..189.48 rows=3,241 width=192) (actual time=4.136..8.84 rows=3,672 loops=1)

  • Buffers: shared hit=71
33. 0.855 0.855 ↑ 1.0 1,907 1

Seq Scan on approval_request_history_document a4 (cost=0..34.18 rows=1,918 width=32) (actual time=0.01..0.855 rows=1,907 loops=1)

  • Buffers: shared hit=15
34. 2.118 4.046 ↑ 1.0 3,234 1

Hash (cost=88.41..88.41 rows=3,241 width=160) (actual time=4.046..4.046 rows=3,234 loops=1)

  • Buffers: shared hit=56
35. 1.928 1.928 ↑ 1.0 3,234 1

Seq Scan on approval_request_history a3 (cost=0..88.41 rows=3,241 width=160) (actual time=0.013..1.928 rows=3,234 loops=1)

  • Buffers: shared hit=56
36. 3.036 24.235 ↓ 2.1 2,028 1

Hash (cost=298.08..298.08 rows=953 width=908) (actual time=24.235..24.235 rows=2,028 loops=1)

  • Buffers: shared hit=73
37. 2.790 21.199 ↓ 2.1 2,028 1

Hash Join (cost=262.52..298.08 rows=953 width=908) (actual time=17.254..21.199 rows=2,028 loops=1)

  • Buffers: shared hit=73
38. 0.928 2.272 ↓ 1.0 995 1

Hash Join (cost=34.44..56.9 rows=953 width=116) (actual time=1.104..2.272 rows=995 loops=1)

  • Buffers: shared hit=19
39. 0.280 0.280 ↑ 1.0 687 1

Seq Scan on preliminary_approval_resolution_document p0 (cost=0..12.93 rows=693 width=32) (actual time=0.008..0.28 rows=687 loops=1)

  • Buffers: shared hit=6
40. 0.487 1.064 ↑ 1.0 944 1

Hash (cost=22.53..22.53 rows=953 width=84) (actual time=1.064..1.064 rows=944 loops=1)

  • Buffers: shared hit=13
41. 0.577 0.577 ↑ 1.0 944 1

Seq Scan on preliminary_approval p (cost=0..22.53 rows=953 width=84) (actual time=0.014..0.577 rows=944 loops=1)

  • Buffers: shared hit=13
42. 1.862 16.137 ↓ 1.2 1,105 1

Hash (cost=216.82..216.82 rows=901 width=792) (actual time=16.137..16.137 rows=1,105 loops=1)

  • Buffers: shared hit=54
43. 1.117 14.275 ↓ 1.2 1,105 1

Hash Join (cost=122.88..216.82 rows=901 width=792) (actual time=4.792..14.275 rows=1,105 loops=1)

  • Buffers: shared hit=54
44. 1.165 13.116 ↓ 1.2 1,093 1

Hash Join (cost=121.07..209.21 rows=901 width=760) (actual time=4.736..13.116 rows=1,093 loops=1)

  • Buffers: shared hit=53
45. 1.210 11.736 ↓ 1.2 1,071 1

Hash Join (cost=113.53..184.52 rows=901 width=728) (actual time=4.506..11.736 rows=1,071 loops=1)

  • Buffers: shared hit=51
46. 0.872 8.732 ↑ 1.0 897 1

Hash Join (cost=73.81..134.75 rows=901 width=615) (actual time=2.698..8.732 rows=897 loops=1)

  • Buffers: shared hit=40
47. 1.139 7.851 ↑ 1.0 897 1

Hash Join (cost=72.79..130.34 rows=901 width=583) (actual time=2.677..7.851 rows=897 loops=1)

  • Buffers: shared hit=39
48. 0.865 5.801 ↑ 1.0 897 1

Hash Join (cost=41.51..86.68 rows=901 width=519) (actual time=1.753..5.801 rows=897 loops=1)

  • Buffers: shared hit=28
49. 0.891 4.780 ↑ 1.0 897 1

Hash Join (cost=36.5..76.94 rows=901 width=454) (actual time=1.584..4.78 rows=897 loops=1)

  • Buffers: shared hit=26
50. 0.795 3.435 ↑ 1.0 897 1

Hash Join (cost=24.04..57.35 rows=901 width=382) (actual time=1.115..3.435 rows=897 loops=1)

  • Buffers: shared hit=22
51. 1.089 2.591 ↑ 1.0 897 1

Hash Join (cost=21.98..51.44 rows=901 width=350) (actual time=1.055..2.591 rows=897 loops=1)

  • Buffers: shared hit=21
52. 0.478 0.478 ↑ 1.0 897 1

Seq Scan on invest_program_version i0 (cost=0..23.01 rows=901 width=205) (actual time=0.011..0.478 rows=897 loops=1)

  • Buffers: shared hit=14
53. 0.286 1.024 ↑ 1.0 306 1

Hash (cost=18.14..18.14 rows=307 width=145) (actual time=1.024..1.024 rows=306 loops=1)

  • Buffers: shared hit=7
54. 0.391 0.738 ↑ 1.0 306 1

Hash Join (cost=7.79..18.14 rows=307 width=145) (actual time=0.22..0.738 rows=306 loops=1)

  • Buffers: shared hit=7
55. 0.147 0.147 ↑ 1.0 306 1

Seq Scan on statement s (cost=0..7.07 rows=307 width=81) (actual time=0.009..0.147 rows=306 loops=1)

  • Buffers: shared hit=4
56. 0.107 0.200 ↑ 1.0 212 1

Hash (cost=5.13..5.13 rows=213 width=64) (actual time=0.2..0.2 rows=212 loops=1)

  • Buffers: shared hit=3
57. 0.093 0.093 ↑ 1.0 212 1

Seq Scan on final_document f (cost=0..5.13 rows=213 width=64) (actual time=0.01..0.093 rows=212 loops=1)

  • Buffers: shared hit=3
58. 0.023 0.049 ↑ 1.0 47 1

Hash (cost=1.47..1.47 rows=47 width=32) (actual time=0.049..0.049 rows=47 loops=1)

  • Buffers: shared hit=1
59. 0.026 0.026 ↑ 1.0 47 1

Seq Scan on disagreement_protocol d (cost=0..1.47 rows=47 width=32) (actual time=0.007..0.026 rows=47 loops=1)

  • Buffers: shared hit=1
60. 0.224 0.454 ↑ 1.0 373 1

Hash (cost=7.76..7.76 rows=376 width=72) (actual time=0.454..0.454 rows=373 loops=1)

  • Buffers: shared hit=4
61. 0.230 0.230 ↑ 1.0 373 1

Seq Scan on check c (cost=0..7.76 rows=376 width=72) (actual time=0.011..0.23 rows=373 loops=1)

  • Buffers: shared hit=4
62. 0.065 0.156 ↑ 1.0 131 1

Hash (cost=3.34..3.34 rows=134 width=65) (actual time=0.156..0.156 rows=131 loops=1)

  • Buffers: shared hit=2
63. 0.091 0.091 ↑ 1.0 131 1

Seq Scan on getting_result_approval g (cost=0..3.34 rows=134 width=65) (actual time=0.013..0.091 rows=131 loops=1)

  • Buffers: shared hit=2
64. 0.526 0.911 ↑ 1.0 897 1

Hash (cost=20.01..20.01 rows=901 width=64) (actual time=0.911..0.911 rows=897 loops=1)

  • Buffers: shared hit=11
65. 0.385 0.385 ↑ 1.0 897 1

Seq Scan on invest_program_presentation_form i1 (cost=0..20.01 rows=901 width=64) (actual time=0.01..0.385 rows=897 loops=1)

  • Buffers: shared hit=11
66. 0.004 0.009 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=32) (actual time=0.009..0.009 rows=1 loops=1)

  • Buffers: shared hit=1
67. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on activities_verification_document a2 (cost=0..1.01 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=1)

  • Buffers: shared hit=1
68. 0.425 1.794 ↓ 1.1 610 1

Hash (cost=32.8..32.8 rows=554 width=113) (actual time=1.794..1.794 rows=610 loops=1)

  • Buffers: shared hit=11
69. 0.557 1.369 ↓ 1.1 610 1

Hash Join (cost=20.46..32.8 rows=554 width=113) (actual time=0.683..1.369 rows=610 loops=1)

  • Buffers: shared hit=11
70. 0.154 0.154 ↑ 1.0 393 1

Seq Scan on final_approval_resolution_document f1 (cost=0..6.93 rows=393 width=32) (actual time=0.008..0.154 rows=393 loops=1)

  • Buffers: shared hit=3
71. 0.369 0.658 ↑ 1.0 553 1

Hash (cost=13.54..13.54 rows=554 width=81) (actual time=0.658..0.658 rows=553 loops=1)

  • Buffers: shared hit=8
72. 0.289 0.289 ↑ 1.0 553 1

Seq Scan on final_approval f0 (cost=0..13.54 rows=554 width=81) (actual time=0.012..0.289 rows=553 loops=1)

  • Buffers: shared hit=8
73. 0.113 0.215 ↑ 1.0 243 1

Hash (cost=4.46..4.46 rows=246 width=32) (actual time=0.215..0.215 rows=243 loops=1)

  • Buffers: shared hit=2
74. 0.102 0.102 ↑ 1.0 243 1

Seq Scan on resolution_document r (cost=0..4.46 rows=246 width=32) (actual time=0.011..0.102 rows=243 loops=1)

  • Buffers: shared hit=2
75. 0.026 0.042 ↑ 1.0 36 1

Hash (cost=1.36..1.36 rows=36 width=32) (actual time=0.042..0.042 rows=36 loops=1)

  • Buffers: shared hit=1
76. 0.016 0.016 ↑ 1.0 36 1

Seq Scan on getting_result_approval_resolution_document g0 (cost=0..1.36 rows=36 width=32) (actual time=0.007..0.016 rows=36 loops=1)

  • Buffers: shared hit=1
77. 0.728 4.627 ↓ 1.1 834 1

Hash (cost=71.17..71.17 rows=742 width=305) (actual time=4.627..4.627 rows=834 loops=1)

  • Buffers: shared hit=24
78. 0.696 3.899 ↓ 1.1 834 1

Hash Join (cost=62.78..71.17 rows=742 width=305) (actual time=3.119..3.899 rows=834 loops=1)

  • Buffers: shared hit=24
79. 0.102 0.102 ↑ 1.0 269 1

Seq Scan on approval_request_connection_requests a1 (cost=0..4.69 rows=269 width=32) (actual time=0.009..0.102 rows=269 loops=1)

  • Buffers: shared hit=2
80. 0.562 3.101 ↓ 1.0 771 1

Hash (cost=53.5..53.5 rows=742 width=273) (actual time=3.101..3.101 rows=771 loops=1)

  • Buffers: shared hit=22
81. 0.582 2.539 ↓ 1.0 771 1

Hash Join (cost=49.2..53.5 rows=742 width=273) (actual time=1.934..2.539 rows=771 loops=1)

  • Buffers: shared hit=22
82. 0.111 0.111 ↑ 1.0 97 1

Seq Scan on investment_program_implementation_report i (cost=0..2.97 rows=97 width=76) (actual time=0.017..0.111 rows=97 loops=1)

  • Buffers: shared hit=2
83. 0.487 1.846 ↑ 1.0 711 1

Hash (cost=39.92..39.92 rows=742 width=197) (actual time=1.846..1.846 rows=711 loops=1)

  • Buffers: shared hit=20
84. 0.458 1.359 ↑ 1.0 711 1

Hash Join (cost=35.7..39.92 rows=742 width=197) (actual time=0.821..1.359 rows=711 loops=1)

  • Buffers: shared hit=20
85. 0.113 0.113 ↑ 1.0 136 1

Seq Scan on approval_request_required_documents a0 (cost=0..2.36 rows=136 width=32) (actual time=0.007..0.113 rows=136 loops=1)

  • Buffers: shared hit=1
86. 0.413 0.788 ↑ 1.2 623 1

Hash (cost=26.42..26.42 rows=742 width=165) (actual time=0.788..0.788 rows=623 loops=1)

  • Buffers: shared hit=19
87. 0.375 0.375 ↑ 1.2 623 1

Seq Scan on approval_request a (cost=0..26.42 rows=742 width=165) (actual time=0.017..0.375 rows=623 loops=1)

  • Buffers: shared hit=19
88. 0.237 2.039 ↑ 1.4 450 1

Hash (cost=16,487.45..16,487.45 rows=614 width=16) (actual time=2.039..2.039 rows=450 loops=1)

  • Buffers: shared hit=35
89. 0.557 1.802 ↑ 1.4 450 1

HashAggregate (cost=16,481.31..16,487.45 rows=614 width=16) (actual time=1.624..1.802 rows=450 loops=1)

  • Group Key: i2.approval_request_id
  • Buffers: shared hit=35
90. 0.788 1.245 ↑ 1.3 671 1

Seq Scan on invest_program_version i2 (cost=0..16,479.2 rows=845 width=16) (actual time=0.794..1.245 rows=671 loops=1)

  • Filter: ((i2.ministry_organization_id = 'f59bb956-5e31-4f91-86df-d01f6c36e173'::uuid) OR (alternatives: SubPlan 1 or hashed SubPlan 2) OR (alternatives: SubPlan 3 or hashed SubPlan 4))
  • Buffers: shared hit=35
91.          

SubPlan (for Seq Scan)

92. 0.000 0.000 ↓ 0.0 0 0

Bitmap Heap Scan on preliminary_approval p1 (cost=4.29..9.97 rows=1 width=0) (never executed)

  • Filter: (p1.approval_organization_id = 'f59bb956-5e31-4f91-86df-d01f6c36e173'::uuid)
93. 0.000 0.000 ↓ 0.0 0 0

Bitmap Index Scan on ix_preliminary_approval_invest_program_version_id (cost=0..4.29 rows=2 width=0) (never executed)

  • Index Cond: (i2.id = p1.invest_program_version_id)
94. 0.215 0.215 ↑ 2.0 1 1

Seq Scan on preliminary_approval p1_1 (cost=0..24.91 rows=2 width=16) (actual time=0.049..0.215 rows=1 loops=1)

  • Filter: (p1_1.approval_organization_id = 'f59bb956-5e31-4f91-86df-d01f6c36e173'::uuid)
  • Buffers: shared hit=13
95. 0.000 0.000 ↓ 0.0 0 0

Index Scan using ix_final_approval_version_id on final_approval f2 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: (i2.id = f2.version_id)
  • Filter: (f2.approval_organization_id = 'f59bb956-5e31-4f91-86df-d01f6c36e173'::uuid)
96. 0.242 0.242 ↑ 1.0 375 1

Seq Scan on final_approval f2_1 (cost=0..14.93 rows=376 width=16) (actual time=0.025..0.242 rows=375 loops=1)

  • Filter: (f2_1.approval_organization_id = 'f59bb956-5e31-4f91-86df-d01f6c36e173'::uuid)
  • Buffers: shared hit=8
Planning time : 13.234 ms
Execution time : 107,471.031 ms