explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 19,331.444 84,706.836 ↓ 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=75.781..84,706.836 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))
2. 1,367.642 3,161.705 ↓ 2.0 1,637,202 1

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

  • Hash Cond: (activity_response.reference_activity_response_value_id = reference_activity_response_value.id)
3. 1,008.173 1,794.045 ↓ 2.0 1,637,202 1

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

  • Hash Cond: (prog.id = period.integration_program_id)
4. 290.464 785.817 ↓ 1.9 276,257 1

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

  • Hash Cond: (activity_response.activity_id = activity.id)
5. 352.016 494.970 ↓ 1.9 276,257 1

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

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

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

7. 6.058 75.074 ↓ 1.9 6,582 1

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

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 1347kB
8. 5.687 69.016 ↓ 1.9 6,582 1

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

9. 3.097 37.001 ↓ 1.9 6,582 1

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

  • Hash Cond: (prog.concession_id = concession.id_concession)
10. 15.197 33.886 ↓ 1.9 6,582 1

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

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

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

12. 4.085 10.168 ↓ 1.9 6,582 1

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

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 887kB
13. 4.550 6.083 ↓ 1.9 6,582 1

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

  • Hash Cond: (cp.integration_program_id = prog.id)
14. 1.519 1.519 ↑ 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.010..1.519 rows=6,917 loops=1)

15. 0.003 0.014 ↑ 1.0 3 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.011 0.011 ↑ 1.0 3 1

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

  • Filter: enable
  • Rows Removed by Filter: 3
17. 0.005 0.018 ↑ 1.0 5 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.013 0.013 ↑ 1.0 5 1

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

19. 26.328 26.328 ↑ 1.0 1 6,582

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

  • Index Cond: (id_people = collaborator.id_people)
20. 0.160 0.383 ↑ 1.0 481 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 92kB
21. 0.223 0.223 ↑ 1.0 481 1

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

  • Filter: (NOT is_disabled)
22. 0.016 0.055 ↑ 1.0 34 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
23. 0.039 0.039 ↑ 1.0 34 1

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

24. 0.006 0.018 ↑ 1.0 10 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
25. 0.012 0.012 ↑ 1.0 10 1

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

26. 0.004 0.011 ↑ 1.0 3 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
27. 0.007 0.007 ↑ 1.0 3 1

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

28.          

SubPlan (forHash Left Join)

29. 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
30. 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)

31. 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.002..0.003 rows=1 loops=1,637,202)

  • Index Cond: (id_collaborator = collaborator.id_people)
32. 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)
33. 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.007..0.008 rows=1 loops=1,637,202)

34. 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)

35. 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)
36. 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)
37. 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)
38. 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)

39. 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)

40. 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)
41. 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)
42. 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)
43. 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
44. 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