explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nHGM : Optimization for: Optimization for: Optimization for: plan #Xm5O; plan #aknL; plan #SxMR

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,314.207 110,283.266 ↓ 2.0 1,637,202 1

Unique (cost=51,368,352.47..51,386,680.43 rows=814,576 width=1,909) (actual time=105,797.460..110,283.266 rows=1,637,202 loops=1)

2. 22,570.547 108,969.059 ↓ 2.0 1,637,202 1

Sort (cost=51,368,352.47..51,370,388.91 rows=814,576 width=1,909) (actual time=105,797.456..108,969.059 rows=1,637,202 loops=1)

  • Sort Key: prog.id, period.id, concession.id_concession, cp.id, cp.collaborator_id, activity_response.id, activity_response.activity_id, activity_response.reference_activity_response_value_id
  • Sort Method: external merge Disk: 760112kB
3. 20,953.382 86,398.512 ↓ 2.0 1,637,202 1

Hash Left Join (cost=3,771.34..50,614,600.66 rows=814,576 width=1,909) (actual time=117.403..86,398.512 rows=1,637,202 loops=1)

  • Hash Cond: ((activity.reference_activity_response_id = reference_activity_response.id) AND (reference_activity_response_value.reference_activity_response_id = reference_activity_response.id))
4. 1,312.038 3,231.438 ↓ 2.0 1,637,202 1

Hash Left Join (cost=3,770.27..16,394.05 rows=814,576 width=1,565) (actual time=117.148..3,231.438 rows=1,637,202 loops=1)

  • Hash Cond: (activity_response.reference_activity_response_value_id = reference_activity_response_value.id)
5. 1,065.488 1,919.375 ↓ 2.0 1,637,202 1

Hash Join (cost=3,769.04..13,348.35 rows=814,576 width=1,509) (actual time=117.112..1,919.375 rows=1,637,202 loops=1)

  • Hash Cond: (prog.id = period.integration_program_id)
6. 287.232 853.828 ↓ 1.9 276,257 1

Hash Left Join (cost=3,767.28..11,370.31 rows=143,729 width=989) (actual time=117.036..853.828 rows=276,257 loops=1)

  • Hash Cond: (activity_response.activity_id = activity.id)
7. 365.993 565.943 ↓ 1.9 276,257 1

Hash Right Join (cost=3,744.45..10,966.87 rows=143,729 width=810) (actual time=116.361..565.943 rows=276,257 loops=1)

  • Hash Cond: (activity_response.collaborator_integration_program_id = cp.id)
8. 83.661 83.661 ↑ 1.0 287,500 1

Seq Scan on activity_response (cost=0.00..4,707.00 rows=287,500 width=24) (actual time=0.034..83.661 rows=287,500 loops=1)

9. 9.906 116.289 ↓ 1.9 6,582 1

Hash (cost=3,701.23..3,701.23 rows=3,458 width=790) (actual time=116.288..116.289 rows=6,582 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 1347kB
10. 8.402 106.383 ↓ 1.9 6,582 1

Nested Loop (cost=220.88..3,701.23 rows=3,458 width=790) (actual time=8.824..106.383 rows=6,582 loops=1)

11. 4.138 51.907 ↓ 1.9 6,582 1

Hash Join (cost=220.59..2,033.17 rows=3,458 width=774) (actual time=8.786..51.907 rows=6,582 loops=1)

  • Hash Cond: (prog.concession_id = concession.id_concession)
12. 24.653 47.746 ↓ 1.9 6,582 1

Hash Join (cost=219.48..2,016.57 rows=3,458 width=616) (actual time=8.752..47.746 rows=6,582 loops=1)

  • Hash Cond: (collaborator.id_people = cp.collaborator_id)
13. 15.622 15.622 ↑ 1.0 41,492 1

Seq Scan on collaborator (cost=0.00..1,606.92 rows=41,492 width=44) (actual time=0.028..15.622 rows=41,492 loops=1)

14. 2.799 7.471 ↓ 1.9 6,582 1

Hash (cost=176.25..176.25 rows=3,458 width=572) (actual time=7.471..7.471 rows=6,582 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 887kB
15. 3.124 4.672 ↓ 1.9 6,582 1

Hash Join (cost=1.10..176.25 rows=3,458 width=572) (actual time=0.066..4.672 rows=6,582 loops=1)

  • Hash Cond: (cp.integration_program_id = prog.id)
16. 1.521 1.521 ↑ 1.0 6,917 1

Seq Scan on collaborator_integration_program cp (cost=0.00..144.17 rows=6,917 width=48) (actual time=0.026..1.521 rows=6,917 loops=1)

17. 0.008 0.027 ↑ 1.0 3 1

Hash (cost=1.06..1.06 rows=3 width=524) (actual time=0.026..0.027 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.019 0.019 ↑ 1.0 3 1

Seq Scan on integration_program prog (cost=0.00..1.06 rows=3 width=524) (actual time=0.017..0.019 rows=3 loops=1)

  • Filter: enable
  • Rows Removed by Filter: 3
19. 0.005 0.023 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=162) (actual time=0.023..0.023 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
20. 0.018 0.018 ↑ 1.0 5 1

Seq Scan on concession (cost=0.00..1.05 rows=5 width=162) (actual time=0.015..0.018 rows=5 loops=1)

21. 46.074 46.074 ↑ 1.0 1 6,582

Index Scan using abstractpeople_pkey on abstractpeople (cost=0.29..0.48 rows=1 width=20) (actual time=0.007..0.007 rows=1 loops=6,582)

  • Index Cond: (id_people = collaborator.id_people)
22. 0.295 0.653 ↑ 1.0 481 1

Hash (cost=16.81..16.81 rows=481 width=179) (actual time=0.653..0.653 rows=481 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 92kB
23. 0.358 0.358 ↑ 1.0 481 1

Seq Scan on activity (cost=0.00..16.81 rows=481 width=179) (actual time=0.022..0.358 rows=481 loops=1)

  • Filter: (NOT is_disabled)
24. 0.019 0.059 ↑ 1.0 34 1

Hash (cost=1.34..1.34 rows=34 width=528) (actual time=0.059..0.059 rows=34 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
25. 0.040 0.040 ↑ 1.0 34 1

Seq Scan on period (cost=0.00..1.34 rows=34 width=528) (actual time=0.031..0.040 rows=34 loops=1)

26. 0.008 0.025 ↑ 1.0 10 1

Hash (cost=1.10..1.10 rows=10 width=56) (actual time=0.024..0.025 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
27. 0.017 0.017 ↑ 1.0 10 1

Seq Scan on reference_activity_response_value (cost=0.00..1.10 rows=10 width=56) (actual time=0.014..0.017 rows=10 loops=1)

28. 0.006 0.016 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=150) (actual time=0.016..0.016 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
29. 0.010 0.010 ↑ 1.0 3 1

Seq Scan on reference_activity_response (cost=0.00..1.03 rows=3 width=150) (actual time=0.009..0.010 rows=3 loops=1)

30.          

SubPlan (forHash Left Join)

31. 6,548.808 6,548.808 ↑ 1.0 1 1,637,202

Index Scan using abstractpeople_pkey on abstractpeople jf (cost=0.29..8.31 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=1,637,202)

  • Index Cond: (id_people = collaborator.id_people)
  • Filter: (birth_name IS NOT NULL)
  • Rows Removed by Filter: 0
32. 1,637.202 9,823.212 ↑ 1.0 1 1,637,202

Nested Loop (cost=0.58..16.62 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1,637,202)

33. 4,911.606 4,911.606 ↑ 1.0 1 1,637,202

Index Scan using idx_d20dd34d43ac3d0e on genealogy (cost=0.29..8.31 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=1,637,202)

  • Index Cond: (id_collaborator = collaborator.id_people)
34. 3,274.404 3,274.404 ↑ 1.0 1 1,637,202

Index Scan using genealogy_pkey on genealogy niv0 (cost=0.29..8.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,637,202)

  • Index Cond: (id_genealogy = genealogy.id_tutor)
35. 1,637.202 13,097.616 ↑ 1.0 1 1,637,202

Nested Loop (cost=0.87..17.05 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=1,637,202)

36. 1,637.202 8,186.010 ↑ 1.0 1 1,637,202

Nested Loop (cost=0.58..16.62 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=1,637,202)

37. 3,274.404 3,274.404 ↑ 1.0 1 1,637,202

Index Scan using idx_d20dd34d43ac3d0e on genealogy genealogy_1 (cost=0.29..8.31 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1,637,202)

  • Index Cond: (id_collaborator = collaborator.id_people)
38. 3,274.404 3,274.404 ↑ 1.0 1 1,637,202

Index Scan using genealogy_pkey on genealogy niv0_1 (cost=0.29..8.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,637,202)

  • Index Cond: (id_genealogy = genealogy_1.id_tutor)
39. 3,274.404 3,274.404 ↑ 1.0 1 1,637,202

Index Scan using collaborator_pkey on collaborator parrain (cost=0.29..0.44 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,637,202)

  • Index Cond: (id_people = niv0_1.id_collaborator)
40. 0.000 11,460.414 ↑ 1.0 1 1,637,202

Nested Loop (cost=0.87..17.05 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=1,637,202)

41. 1,637.202 8,186.010 ↑ 1.0 1 1,637,202

Nested Loop (cost=0.58..16.62 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=1,637,202)

42. 3,274.404 3,274.404 ↑ 1.0 1 1,637,202

Index Scan using idx_d20dd34d43ac3d0e on genealogy genealogy_2 (cost=0.29..8.31 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1,637,202)

  • Index Cond: (id_collaborator = collaborator.id_people)
43. 3,274.404 3,274.404 ↑ 1.0 1 1,637,202

Index Scan using genealogy_pkey on genealogy niv0_2 (cost=0.29..8.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,637,202)

  • Index Cond: (id_genealogy = genealogy_2.id_tutor)
44. 3,274.404 3,274.404 ↑ 1.0 1 1,637,202

Index Scan using collaborator_pkey on collaborator parrain_1 (cost=0.29..0.44 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,637,202)

  • Index Cond: (id_people = niv0_2.id_collaborator)
45. 11,460.414 11,460.414 ↑ 1.0 1 1,637,202

Seq Scan on constellation (cost=0.00..1.54 rows=1 width=24) (actual time=0.005..0.007 rows=1 loops=1,637,202)

  • Filter: (id = collaborator.id_constellation)
  • Rows Removed by Filter: 42
46. 9,823.212 9,823.212 ↑ 1.0 1 1,637,202

Seq Scan on constellation constellation_1 (cost=0.00..1.54 rows=1 width=146) (actual time=0.004..0.006 rows=1 loops=1,637,202)

  • Filter: (id = collaborator.id_constellation)
  • Rows Removed by Filter: 42
Planning time : 12.510 ms