explain.depesz.com

PostgreSQL's explain analyze made readable

Result: U5kR

Settings
# exclusive inclusive rows x rows loops node
1. 156.126 10,851.352 ↓ 911.7 41,025 1

Nested Loop (cost=1,277.50..55,928.00 rows=45 width=776) (actual time=21.117..10,851.352 rows=41,025 loops=1)

  • Join Filter: (pd.user_account_uid = ua.uid)
2. 38.525 10,408.051 ↓ 911.7 41,025 1

Nested Loop (cost=1,277.21..55,538.65 rows=45 width=760) (actual time=21.095..10,408.051 rows=41,025 loops=1)

3. 85.652 10,246.451 ↓ 122.8 41,025 1

Nested Loop (cost=1,276.94..55,436.74 rows=334 width=723) (actual time=21.088..10,246.451 rows=41,025 loops=1)

4. 53.313 86.644 ↑ 1.0 41,119 1

Hash Join (cost=1,268.18..4,167.77 rows=41,119 width=663) (actual time=21.010..86.644 rows=41,119 loops=1)

  • Hash Cond: (ci.uid = papu.patient_contact_info_uid)
5. 12.601 12.601 ↑ 1.0 55,136 1

Seq Scan on contact_info ci (cost=0.00..1,661.36 rows=55,136 width=646) (actual time=0.013..12.601 rows=55,136 loops=1)

6. 12.879 20.730 ↑ 1.0 41,119 1

Hash (cost=754.19..754.19 rows=41,119 width=33) (actual time=20.730..20.730 rows=41,119 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 3,123kB
7. 7.851 7.851 ↑ 1.0 41,119 1

Seq Scan on patient_attributes_per_user papu (cost=0.00..754.19 rows=41,119 width=33) (actual time=0.009..7.851 rows=41,119 loops=1)

8. 2,426.021 10,074.155 ↑ 1.0 1 41,119

Hash Join (cost=8.76..10.00 rows=1 width=60) (actual time=0.134..0.245 rows=1 loops=41,119)

  • Hash Cond: (sapu.screening_uid = s.uid)
9. 7,236.944 7,236.944 ↓ 6.2 343 41,119

Index Scan using screening_access_right_user_account_uid_screening_is_archiv_idx on screening_attributes_per_user sapu (cost=0.41..1.44 rows=55 width=35) (actual time=0.008..0.176 rows=343 loops=41,119)

  • Index Cond: (user_account_uid = papu.user_account_uid)
  • Filter: has_access_right
10. 41.119 411.190 ↑ 1.0 1 41,119

Hash (cost=8.33..8.33 rows=1 width=57) (actual time=0.010..0.010 rows=1 loops=41,119)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
11. 41.119 370.071 ↑ 1.0 1 41,119

Subquery Scan on s (cost=8.32..8.33 rows=1 width=57) (actual time=0.009..0.009 rows=1 loops=41,119)

12. 41.119 328.952 ↑ 1.0 1 41,119

Limit (cost=8.32..8.32 rows=1 width=65) (actual time=0.008..0.008 rows=1 loops=41,119)

13. 82.238 287.833 ↑ 1.0 1 41,119

Sort (cost=8.32..8.32 rows=1 width=65) (actual time=0.007..0.007 rows=1 loops=41,119)

  • Sort Key: sr.creation DESC
  • Sort Method: quicksort Memory: 25kB
14. 205.595 205.595 ↑ 1.0 1 41,119

Index Scan using screening_patient_contact_info_uid_idx1 on screening sr (cost=0.29..8.31 rows=1 width=65) (actual time=0.004..0.005 rows=1 loops=41,119)

  • Index Cond: (patient_contact_info_uid = ci.uid)
15. 123.075 123.075 ↑ 1.0 1 41,025

Index Scan using practice_details_user_account_uid_idx on practice_details pd (cost=0.28..0.30 rows=1 width=37) (actual time=0.003..0.003 rows=1 loops=41,025)

  • Index Cond: (user_account_uid = sapu.user_account_uid)
16. 123.075 123.075 ↑ 1.0 1 41,025

Index Scan using user_account_pkey on user_account ua (cost=0.28..0.33 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=41,025)

  • Index Cond: (uid = sapu.user_account_uid)
17.          

SubPlan (for Nested Loop)

18. 164.100 164.100 ↑ 1.0 1 41,025

Index Scan using patient_tag_patient_contact_info_uid_idx on patient_tag pt (cost=0.29..8.31 rows=1 width=5) (actual time=0.004..0.004 rows=1 loops=41,025)

  • Index Cond: (patient_contact_info_uid = ci.uid)
  • Filter: (doctor_uid = pd.user_account_uid)
  • Rows Removed by Filter: 0
Planning time : 5.023 ms
Execution time : 10,854.744 ms