explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NoZs

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,007.034 31,770.115 ↑ 663.7 30 1

Subquery Scan on integrations_fhir_observations (cost=2,044,225.19..2,113,917.28 rows=19,912 width=180) (actual time=27,570.965..31,770.115 rows=30 loops=1)

  • Filter: (integrations_fhir_observations.diagnostic_report_id = 'a516d4c4-b215-4488-ad4b-23e41bbfc137'::uuid)
  • Rows Removed by Filter: 3,856,981
2. 1,818.891 30,763.081 ↑ 1.0 3,857,011 1

Unique (cost=2,044,225.19..2,064,137.21 rows=3,982,405 width=180) (actual time=27,376.980..30,763.081 rows=3,857,011 loops=1)

3. 8,061.397 28,944.190 ↑ 1.0 3,858,314 1

Sort (cost=2,044,225.19..2,054,181.20 rows=3,982,405 width=180) (actual time=27,376.978..28,944.190 rows=3,858,314 loops=1)

  • Sort Key: assessment_computed_values.id
  • Sort Method: external merge Disk: 588,840kB
4. 2,584.050 20,882.793 ↑ 1.0 3,858,314 1

Hash Join (cost=92,604.98..899,837.89 rows=3,982,405 width=180) (actual time=1,015.284..20,882.793 rows=3,858,314 loops=1)

  • Hash Cond: (assessment_computed_values.patient_id = patients.id)
5. 2,071.730 18,273.937 ↑ 1.0 3,858,314 1

Hash Left Join (cost=90,288.22..887,066.15 rows=3,982,405 width=164) (actual time=990.399..18,273.937 rows=3,858,314 loops=1)

  • Hash Cond: (users.id = related_people.user_id)
6. 2,000.711 16,199.868 ↑ 1.0 3,858,314 1

Hash Left Join (cost=90,077.96..868,376.64 rows=3,982,405 width=148) (actual time=988.050..16,199.868 rows=3,858,314 loops=1)

  • Hash Cond: (users.id = providers.user_id)
7. 2,319.626 14,198.478 ↑ 1.0 3,858,314 1

Hash Left Join (cost=90,021.28..857,865.13 rows=3,982,405 width=132) (actual time=987.346..14,198.478 rows=3,858,314 loops=1)

  • Hash Cond: (users.id = taking_patients.user_id)
8. 2,364.705 11,848.026 ↑ 1.0 3,858,314 1

Hash Join (cost=87,704.51..845,093.54 rows=3,982,405 width=116) (actual time=956.430..11,848.026 rows=3,858,314 loops=1)

  • Hash Cond: (assessment_computed_values.user_id = users.id)
9. 4,770.339 9,456.401 ↓ 1.0 4,017,552 1

Hash Left Join (cost=85,112.37..832,046.61 rows=3,982,405 width=116) (actual time=922.516..9,456.401 rows=4,017,552 loops=1)

  • Hash Cond: ((assessment_computed_values.report_id = assessment_invitations.report_id) AND (assessment_computed_values.scale_id = assessment_report_scales.scale_id))
10. 3,764.541 3,764.541 ↓ 1.0 4,016,249 1

Seq Scan on assessment_computed_values (cost=0.00..560,654.05 rows=3,982,405 width=100) (actual time=0.061..3,764.541 rows=4,016,249 loops=1)

11. 81.282 921.521 ↑ 1.0 211,588 1

Hash (cost=80,027.45..80,027.45 rows=213,728 width=48) (actual time=921.520..921.521 rows=211,588 loops=1)

  • Buckets: 65,536 Batches: 8 Memory Usage: 2,580kB
12. 34.909 840.239 ↑ 1.0 211,588 1

Gather (cost=37,712.56..80,027.45 rows=213,728 width=48) (actual time=705.086..840.239 rows=211,588 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
13. 241.267 805.330 ↑ 1.3 70,529 3 / 3

Parallel Hash Join (cost=36,712.56..57,654.65 rows=89,053 width=48) (actual time=700.887..805.330 rows=70,529 loops=3)

  • Hash Cond: (assessment_report_scales.id = assessment_report_scale_participants.report_scale_id)
14. 113.373 113.373 ↑ 1.3 236,845 3 / 3

Parallel Seq Scan on assessment_report_scales (cost=0.00..14,581.39 rows=298,839 width=32) (actual time=0.008..113.373 rows=236,845 loops=3)

15. 48.251 450.690 ↑ 1.3 70,529 3 / 3

Parallel Hash (cost=34,816.40..34,816.40 rows=89,053 width=48) (actual time=450.690..450.690 rows=70,529 loops=3)

  • Buckets: 65,536 Batches: 8 Memory Usage: 2,624kB
16. 63.880 402.439 ↑ 1.3 70,529 3 / 3

Parallel Hash Join (cost=20,706.61..34,816.40 rows=89,053 width=48) (actual time=87.374..402.439 rows=70,529 loops=3)

  • Hash Cond: (assessment_invitations.user_id = users_1.id)
17. 158.131 323.161 ↑ 1.3 70,529 3 / 3

Parallel Hash Join (cost=18,518.05..32,394.05 rows=89,053 width=64) (actual time=71.782..323.161 rows=70,529 loops=3)

  • Hash Cond: (assessment_report_scale_participants.invitation_id = assessment_invitations.id)
18. 93.457 93.457 ↑ 1.3 231,018 3 / 3

Parallel Seq Scan on assessment_report_scale_participants (cost=0.00..13,110.23 rows=291,722 width=48) (actual time=0.006..93.457 rows=231,018 loops=3)

19. 18.621 71.573 ↑ 1.3 29,119 3 / 3

Parallel Hash (cost=18,062.92..18,062.92 rows=36,410 width=48) (actual time=71.572..71.573 rows=29,119 loops=3)

  • Buckets: 131,072 Batches: 1 Memory Usage: 7,904kB
20. 52.952 52.952 ↑ 1.3 29,119 3 / 3

Parallel Seq Scan on assessment_invitations (cost=0.00..18,062.92 rows=36,410 width=48) (actual time=0.030..52.952 rows=29,119 loops=3)

  • Filter: ((status)::text = ANY ('{begun,complete}'::text[]))
  • Rows Removed by Filter: 66,716
21. 8.005 15.398 ↑ 1.8 14,535 3 / 3

Parallel Hash (cost=1,868.25..1,868.25 rows=25,625 width=16) (actual time=15.397..15.398 rows=14,535 loops=3)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,624kB
22. 7.393 7.393 ↑ 1.8 14,535 3 / 3

Parallel Seq Scan on users users_1 (cost=0.00..1,868.25 rows=25,625 width=16) (actual time=0.006..7.393 rows=14,535 loops=3)

23. 13.135 26.920 ↓ 1.0 43,606 1

Hash (cost=2,047.62..2,047.62 rows=43,562 width=16) (actual time=26.920..26.920 rows=43,606 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,557kB
24. 13.785 13.785 ↓ 1.0 43,606 1

Seq Scan on users (cost=0.00..2,047.62 rows=43,562 width=16) (actual time=0.006..13.785 rows=43,606 loops=1)

25. 13.206 30.826 ↑ 1.0 37,931 1

Hash (cost=1,840.23..1,840.23 rows=38,123 width=32) (actual time=30.825..30.826 rows=37,931 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,883kB
26. 17.620 17.620 ↑ 1.0 37,975 1

Seq Scan on patients taking_patients (cost=0.00..1,840.23 rows=38,123 width=32) (actual time=0.010..17.620 rows=37,975 loops=1)

27. 0.336 0.679 ↓ 1.0 1,121 1

Hash (cost=42.97..42.97 rows=1,097 width=32) (actual time=0.678..0.679 rows=1,121 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 87kB
28. 0.343 0.343 ↓ 1.0 1,121 1

Seq Scan on providers (cost=0.00..42.97 rows=1,097 width=32) (actual time=0.011..0.343 rows=1,121 loops=1)

29. 1.161 2.339 ↓ 1.0 3,958 1

Hash (cost=161.78..161.78 rows=3,878 width=32) (actual time=2.339..2.339 rows=3,958 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 280kB
30. 1.178 1.178 ↓ 1.0 3,958 1

Seq Scan on related_people (cost=0.00..161.78 rows=3,878 width=32) (actual time=0.006..1.178 rows=3,958 loops=1)

31. 12.096 24.806 ↑ 1.0 37,975 1

Hash (cost=1,840.23..1,840.23 rows=38,123 width=32) (actual time=24.806..24.806 rows=37,975 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,886kB
32. 12.710 12.710 ↑ 1.0 37,975 1

Seq Scan on patients (cost=0.00..1,840.23 rows=38,123 width=32) (actual time=0.008..12.710 rows=37,975 loops=1)

Planning time : 2.655 ms