explain.depesz.com

PostgreSQL's explain analyze made readable

Result: msEy : Optimization reference_activity_reponse

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 19,491.324 86,769.814 ↓ 2.0 1,640,588 1

Hash Left Join (cost=3,775.82..50,716,230.44 rows=816,214 width=1,909) (actual time=120.991..86,769.814 rows=1,640,588 loops=1)

  • Hash Cond: (reference_activity_response_value.reference_activity_response_id = reference_activity_response.id)
2. 1,387.740 3,292.341 ↓ 2.0 1,640,588 1

Hash Left Join (cost=3,774.75..16,424.34 rows=816,214 width=1,565) (actual time=117.460..3,292.341 rows=1,640,588 loops=1)

  • Hash Cond: (activity_response.reference_activity_response_value_id = reference_activity_response_value.id)
3. 994.704 1,904.572 ↓ 2.0 1,640,588 1

Hash Join (cost=3,773.53..13,372.52 rows=816,214 width=1,509) (actual time=117.409..1,904.572 rows=1,640,588 loops=1)

  • Hash Cond: (prog.id = period.integration_program_id)
4. 291.593 909.036 ↓ 1.9 276,832 1

Hash Left Join (cost=3,771.76..11,389.93 rows=144,060 width=989) (actual time=116.561..909.036 rows=276,832 loops=1)

  • Hash Cond: (activity_response.activity_id = activity.id)
5. 357.625 608.787 ↓ 1.9 276,832 1

Hash Right Join (cost=3,748.94..10,985.61 rows=144,060 width=810) (actual time=107.875..608.787 rows=276,832 loops=1)

  • Hash Cond: (activity_response.collaborator_integration_program_id = cp.id)
6. 143.352 143.352 ↑ 1.0 288,078 1

Seq Scan on activity_response (cost=0.00..4,715.78 rows=288,078 width=24) (actual time=0.020..143.352 rows=288,078 loops=1)

7. 9.643 107.810 ↓ 1.9 6,588 1

Hash (cost=3,705.67..3,705.67 rows=3,462 width=790) (actual time=107.809..107.810 rows=6,588 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 1348kB
8. 11.697 98.167 ↓ 1.9 6,588 1

Nested Loop (cost=222.02..3,705.67 rows=3,462 width=790) (actual time=14.947..98.167 rows=6,588 loops=1)

9. 4.042 53.530 ↓ 1.9 6,588 1

Hash Join (cost=221.73..2,035.77 rows=3,462 width=774) (actual time=14.895..53.530 rows=6,588 loops=1)

  • Hash Cond: (prog.concession_id = concession.id_concession)
10. 21.945 49.466 ↓ 1.9 6,588 1

Hash Join (cost=220.61..2,019.15 rows=3,462 width=616) (actual time=14.861..49.466 rows=6,588 loops=1)

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

Seq Scan on collaborator (cost=0.00..1,608.21 rows=41,521 width=44) (actual time=0.012..12.698 rows=41,521 loops=1)

12. 4.123 14.823 ↓ 1.9 6,588 1

Hash (cost=177.34..177.34 rows=3,462 width=572) (actual time=14.823..14.823 rows=6,588 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 888kB
13. 4.803 10.700 ↓ 1.9 6,588 1

Hash Join (cost=1.10..177.34 rows=3,462 width=572) (actual time=0.671..10.700 rows=6,588 loops=1)

  • Hash Cond: (cp.integration_program_id = prog.id)
14. 5.263 5.263 ↑ 1.0 6,923 1

Seq Scan on collaborator_integration_program cp (cost=0.00..145.23 rows=6,923 width=48) (actual time=0.013..5.263 rows=6,923 loops=1)

15. 0.007 0.634 ↑ 1.0 3 1

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

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

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

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

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

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

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

19. 32.940 32.940 ↑ 1.0 1 6,588

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

  • Index Cond: (id_people = collaborator.id_people)
20. 0.433 8.656 ↑ 1.0 481 1

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

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

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

  • Filter: (NOT is_disabled)
22. 0.021 0.832 ↑ 1.0 34 1

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

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

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

24. 0.012 0.029 ↑ 1.0 10 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
25. 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)

26. 0.031 3.217 ↑ 1.0 3 1

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

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

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

28.          

SubPlan (forHash Left Join)

29. 6,562.352 6,562.352 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_people = collaborator.id_people)
  • Filter: (birth_name IS NOT NULL)
  • Rows Removed by Filter: 0
30. 1,640.588 9,843.528 ↑ 1.0 1 1,640,588

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

31. 4,921.764 4,921.764 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_collaborator = collaborator.id_people)
32. 3,281.176 3,281.176 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_genealogy = genealogy.id_tutor)
33. 1,640.588 13,124.704 ↑ 1.0 1 1,640,588

Nested Loop (cost=0.87..17.05 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=1,640,588)

34. 1,640.588 8,202.940 ↑ 1.0 1 1,640,588

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

35. 3,281.176 3,281.176 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_collaborator = collaborator.id_people)
36. 3,281.176 3,281.176 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_genealogy = genealogy_1.id_tutor)
37. 3,281.176 3,281.176 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_people = niv0_1.id_collaborator)
38. 1,640.588 13,124.704 ↑ 1.0 1 1,640,588

Nested Loop (cost=0.87..17.05 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=1,640,588)

39. 1,640.588 8,202.940 ↑ 1.0 1 1,640,588

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

40. 3,281.176 3,281.176 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_collaborator = collaborator.id_people)
41. 3,281.176 3,281.176 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_genealogy = genealogy_2.id_tutor)
42. 3,281.176 3,281.176 ↑ 1.0 1 1,640,588

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,640,588)

  • Index Cond: (id_people = niv0_2.id_collaborator)
43. 11,484.116 11,484.116 ↑ 1.0 1 1,640,588

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

  • Filter: (id = collaborator.id_constellation)
  • Rows Removed by Filter: 42
44. 9,843.528 9,843.528 ↑ 1.0 1 1,640,588

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,640,588)

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