explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xm5O

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,953.090 173,819.464 ↓ 2.0 1,637,202 1

Unique (cost=51,368,352.47..51,466,101.59 rows=814,576 width=1,909) (actual time=157,825.967..173,819.464 rows=1,637,202 loops=1)

2. 85,074.940 171,866.374 ↓ 2.0 1,637,202 1

Sort (cost=51,368,352.47..51,370,388.91 rows=814,576 width=1,909) (actual time=157,825.963..171,866.374 rows=1,637,202 loops=1)

  • Sort Key: concession.name, concession.id_concession, concession.iso_code, prog.id, prog.label, period.id, period.label, period.marker, cp.id, cp.collaborator_id, collaborator.id_old_archi, collaborator.id_concession, collaborator.contract_name, (replace(COALESCE(((abstractpeople.last_name)::text || (SubPlan 1)), (abstractpeople.last_name)::text), '()'::text, ''::text)), abstractpeople.first_name, ((SubPlan 2)), ((SubPlan 3)), ((SubPlan 4)), ((SubPlan 5)), ((SubPlan 6)), collaborator.enabled_at, cp.start_date, cp.start_date_limit, cp.delayed_start_date, cp.delayed_period_date, cp.end_date, cp.createdat, activity_response.id, activity_response.activity_id, activity_response.reference_activity_response_value_id, activity_response.response_date, reference_activity_response.id, reference_activity_response.label, reference_activity_response_value.id, reference_activity_response_value.label, reference_activity_response_value.is_negative_response, activity.id, activity.period_id, activity.reference_activity_response_id, activity.label, activity."position", activity.description, activity.question, activity.createdat, activity.tutor_needed, activity.specific_tool, activity.technological
  • Sort Method: external merge Disk: 760112kB
3. 20,473.704 86,791.434 ↓ 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=817.183..86,791.434 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,354.570 4,103.368 ↓ 2.0 1,637,202 1

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

  • Hash Cond: (activity_response.reference_activity_response_value_id = reference_activity_response_value.id)
5. 1,096.764 2,748.768 ↓ 2.0 1,637,202 1

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

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

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

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

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

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

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

9. 10.141 803.963 ↓ 1.9 6,582 1

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

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

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

11. 3.518 79.652 ↓ 1.9 6,582 1

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

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

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

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

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

14. 3.032 10.033 ↓ 1.9 6,582 1

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

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

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

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

17. 0.016 0.564 ↑ 1.0 3 1

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

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

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

  • Filter: enable
  • Rows Removed by Filter: 3
19. 0.011 0.597 ↑ 1.0 5 1

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

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

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

21. 704.274 704.274 ↑ 1.0 1 6,582

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

  • Index Cond: (id_people = collaborator.id_people)
22. 0.319 7.003 ↑ 1.0 481 1

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

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

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

  • Filter: (NOT is_disabled)
24. 0.017 0.759 ↑ 1.0 34 1

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

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

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

26. 0.014 0.030 ↑ 1.0 10 1

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

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

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

28. 0.016 0.686 ↑ 1.0 3 1

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

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

Seq Scan on reference_activity_response (cost=0.00..1.03 rows=3 width=150) (actual time=0.668..0.670 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.007..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 : 7.703 ms