explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QmT1

Settings
# exclusive inclusive rows x rows loops node
1. 1,667.074 43,787.014 ↑ 197.7 98 1

Subquery Scan on integrations_fhir_observations (cost=1,990,179.55..2,057,982.19 rows=19,372 width=180) (actual time=36,701.598..43,787.014 rows=98 loops=1)

  • Filter: (integrations_fhir_observations.diagnostic_report_id = 'af4a91b0-6abe-4dd0-8eb7-edeb2e8ced92'::uuid)
  • Rows Removed by Filter: 3,739,413
2. 2,912.413 42,119.940 ↑ 1.0 3,739,511 1

Unique (cost=1,990,179.55..2,009,551.73 rows=3,874,437 width=180) (actual time=36,701.595..42,119.940 rows=3,739,511 loops=1)

3. 11,542.166 39,207.527 ↑ 1.0 3,740,618 1

Sort (cost=1,990,179.55..1,999,865.64 rows=3,874,437 width=180) (actual time=36,701.593..39,207.527 rows=3,740,618 loops=1)

  • Sort Key: assessment_computed_values.id
  • Sort Method: external merge Disk: 570,728kB
4. 3,621.122 27,665.361 ↑ 1.0 3,740,618 1

Hash Join (cost=87,960.28..877,583.52 rows=3,874,437 width=180) (actual time=1,387.461..27,665.361 rows=3,740,618 loops=1)

  • Hash Cond: (assessment_computed_values.patient_id = patients.id)
5. 2,894.485 23,994.581 ↑ 1.0 3,740,618 1

Hash Left Join (cost=85,754.05..865,205.70 rows=3,874,437 width=164) (actual time=1,337.711..23,994.581 rows=3,740,618 loops=1)

  • Hash Cond: (users.id = related_people.user_id)
6. 2,820.515 21,096.222 ↑ 1.0 3,740,618 1

Hash Left Join (cost=85,551.83..847,080.14 rows=3,874,437 width=148) (actual time=1,333.824..21,096.222 rows=3,740,618 loops=1)

  • Hash Cond: (users.id = providers.user_id)
7. 3,298.167 18,274.569 ↑ 1.0 3,740,618 1

Hash Left Join (cost=85,496.91..836,853.79 rows=3,874,437 width=132) (actual time=1,332.671..18,274.569 rows=3,740,618 loops=1)

  • Hash Cond: (users.id = taking_patients.user_id)
8. 3,383.104 14,925.844 ↑ 1.0 3,740,618 1

Hash Join (cost=83,290.68..824,476.13 rows=3,874,437 width=116) (actual time=1,282.022..14,925.844 rows=3,740,618 loops=1)

  • Hash Cond: (assessment_computed_values.user_id = users.id)
9. 5,924.249 11,489.458 ↓ 1.0 3,891,822 1

Hash Left Join (cost=80,761.20..811,775.27 rows=3,874,437 width=116) (actual time=1,218.971..11,489.458 rows=3,891,822 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. 4,352.276 4,352.276 ↓ 1.0 3,890,715 1

Seq Scan on assessment_computed_values (cost=0.00..559,574.37 rows=3,874,437 width=100) (actual time=0.397..4,352.276 rows=3,890,715 loops=1)

11. 139.160 1,212.933 ↑ 1.0 199,339 1

Hash (cost=76,017.28..76,017.28 rows=199,395 width=48) (actual time=1,212.933..1,212.933 rows=199,339 loops=1)

  • Buckets: 65,536 Batches: 8 Memory Usage: 2,463kB
12. 50.407 1,073.773 ↑ 1.0 199,339 1

Gather (cost=36,692.38..76,017.28 rows=199,395 width=48) (actual time=892.598..1,073.773 rows=199,339 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
13. 305.633 1,023.366 ↑ 1.3 66,446 3 / 3

Parallel Hash Join (cost=35,692.38..55,077.78 rows=83,081 width=48) (actual time=892.581..1,023.366 rows=66,446 loops=3)

  • Hash Cond: (assessment_report_scales.id = assessment_report_scale_participants.report_scale_id)
14. 150.246 150.246 ↑ 1.3 222,953 3 / 3

Parallel Seq Scan on assessment_report_scales (cost=0.00..13,430.44 rows=279,944 width=32) (actual time=0.006..150.246 rows=222,953 loops=3)

15. 55.151 567.487 ↑ 1.3 66,446 3 / 3

Parallel Hash (cost=33,922.87..33,922.87 rows=83,081 width=48) (actual time=567.487..567.487 rows=66,446 loops=3)

  • Buckets: 65,536 Batches: 8 Memory Usage: 2,528kB
16. 79.042 512.336 ↑ 1.3 66,446 3 / 3

Parallel Hash Join (cost=20,791.81..33,922.87 rows=83,081 width=48) (actual time=136.119..512.336 rows=66,446 loops=3)

  • Hash Cond: (assessment_invitations.user_id = users_1.id)
17. 193.447 409.179 ↑ 1.3 66,446 3 / 3

Parallel Hash Join (cost=18,648.77..31,561.72 rows=83,081 width=64) (actual time=109.871..409.179 rows=66,446 loops=3)

  • Hash Cond: (assessment_report_scale_participants.invitation_id = assessment_invitations.id)
18. 108.027 108.027 ↑ 1.3 218,245 3 / 3

Parallel Seq Scan on assessment_report_scale_participants (cost=0.00..12,193.34 rows=274,134 width=48) (actual time=0.007..108.027 rows=218,245 loops=3)

19. 107.705 107.705 ↑ 1.4 27,697 3 / 3

Parallel Hash (cost=18,165.76..18,165.76 rows=38,641 width=48) (actual time=107.705..107.705 rows=27,697 loops=3)

  • Buckets: 131,072 Batches: 1 Memory Usage: 7,584kB
  • -> Parallel Seq Scan on assessment_invitations (cost=0.00..18165.76 rows=38,641 width=48) (actual time=0.028..77.990rows=27,697 loops=3)
  • Filter: ((status)::text = ANY ('{begun,complete}'::text[]))
  • Rows Removed by Filter: 63,741
20. 13.163 24.115 ↑ 1.8 13,901 3 / 3

Parallel Hash (cost=1,836.35..1,836.35 rows=24,535 width=16) (actual time=24.114..24.115 rows=13,901 loops=3)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,496kB
21. 10.952 10.952 ↑ 1.8 13,901 3 / 3

Parallel Seq Scan on users users_1 (cost=0.00..1,836.35 rows=24,535 width=16) (actual time=0.005..10.952 rows=13,901 loops=3)

22. 26.443 53.282 ↑ 1.0 41,703 1

Hash (cost=2,008.10..2,008.10 rows=41,710 width=16) (actual time=53.282..53.282 rows=41,703 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,467kB
23. 26.839 26.839 ↑ 1.0 41,703 1

Seq Scan on users (cost=0.00..2,008.10 rows=41,710 width=16) (actual time=0.011..26.839 rows=41,703 loops=1)

24. 21.798 50.558 ↑ 1.0 36,315 1

Hash (cost=1,751.66..1,751.66 rows=36,366 width=32) (actual time=50.557..50.558 rows=36,315 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,782kB
25. 28.760 28.760 ↑ 1.0 36,351 1

Seq Scan on patients taking_patients (cost=0.00..1,751.66 rows=36,366 width=32) (actual time=0.009..28.760 rows=36,351 loops=1)

26. 0.572 1.138 ↓ 1.0 1,080 1

Hash (cost=41.63..41.63 rows=1,063 width=32) (actual time=1.137..1.138 rows=1,080 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 84kB
27. 0.566 0.566 ↓ 1.0 1,080 1

Seq Scan on providers (cost=0.00..41.63 rows=1,063 width=32) (actual time=0.009..0.566 rows=1,080 loops=1)

28. 1.984 3.874 ↓ 1.0 3,743 1

Hash (cost=156.54..156.54 rows=3,654 width=32) (actual time=3.874..3.874 rows=3,743 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 266kB
29. 1.890 1.890 ↓ 1.0 3,743 1

Seq Scan on related_people (cost=0.00..156.54 rows=3,654 width=32) (actual time=0.008..1.890 rows=3,743 loops=1)

30. 24.914 49.658 ↑ 1.0 36,351 1

Hash (cost=1,751.66..1,751.66 rows=36,366 width=32) (actual time=49.657..49.658 rows=36,351 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,784kB
31. 24.744 24.744 ↑ 1.0 36,351 1

Seq Scan on patients (cost=0.00..1,751.66 rows=36,366 width=32) (actual time=0.008..24.744 rows=36,351 loops=1)