explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bD8eH

Settings
# exclusive inclusive rows x rows loops node
1. 0.204 0.735 ↓ 1.2 6 1

Nested Loop Left Join (cost=8.61..126.42 rows=5 width=514) (actual time=0.444..0.735 rows=6 loops=1)

2. 0.016 0.501 ↓ 1.2 6 1

Nested Loop Left Join (cost=8.48..121.77 rows=5 width=791) (actual time=0.308..0.501 rows=6 loops=1)

3. 0.017 0.437 ↓ 1.2 6 1

Nested Loop Left Join (cost=8.20..120.29 rows=5 width=765) (actual time=0.282..0.437 rows=6 loops=1)

4. 0.053 0.310 ↑ 1.0 5 1

Hash Left Join (cost=7.77..78.02 rows=5 width=760) (actual time=0.244..0.310 rows=5 loops=1)

  • Hash Cond: (COALESCE(a.clinic_id, a.preferred_clinic_id) = c.clinic_id)
5. 0.010 0.193 ↑ 1.0 5 1

Nested Loop Left Join (cost=1.28..71.51 rows=5 width=744) (actual time=0.135..0.193 rows=5 loops=1)

6. 0.024 0.153 ↑ 1.0 5 1

Nested Loop Left Join (cost=0.85..29.31 rows=5 width=671) (actual time=0.122..0.153 rows=5 loops=1)

  • Join Filter: (a.patient_id = p.patient_id)
7. 0.084 0.084 ↑ 1.0 5 1

Index Scan using i_a_patient_id on tbl_appointment a (cost=0.43..20.79 rows=5 width=583) (actual time=0.069..0.084 rows=5 loops=1)

  • Index Cond: (patient_id = '14533964656201000486390'::numeric)
8. 0.012 0.045 ↑ 1.0 1 5

Materialize (cost=0.42..8.45 rows=1 width=102) (actual time=0.009..0.009 rows=1 loops=5)

9. 0.033 0.033 ↑ 1.0 1 1

Index Scan using pk_tbl_p_patient_id on tbl_patient p (cost=0.42..8.44 rows=1 width=102) (actual time=0.033..0.033 rows=1 loops=1)

  • Index Cond: (patient_id = '14533964656201000486390'::numeric)
10. 0.030 0.030 ↓ 0.0 0 5

Index Scan using pk_tbl_pt_patient_temporary_id on tbl_patient_temporary pt (cost=0.42..8.44 rows=1 width=102) (actual time=0.006..0.006 rows=0 loops=5)

  • Index Cond: (a.patient_temporary_id = patient_temporary_id)
11. 0.029 0.064 ↑ 1.0 22 1

Hash (cost=6.22..6.22 rows=22 width=31) (actual time=0.064..0.064 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.035 0.035 ↑ 1.0 22 1

Seq Scan on tbl_clinic c (cost=0.00..6.22 rows=22 width=31) (actual time=0.012..0.035 rows=22 loops=1)

13. 0.110 0.110 ↑ 1.0 1 5

Index Scan using i_ap_appointment_id on tbl_appointment_procedure ap (cost=0.43..8.45 rows=1 width=20) (actual time=0.020..0.022 rows=1 loops=5)

  • Index Cond: (a.appointment_id = appointment_id)
14. 0.048 0.048 ↑ 1.0 1 6

Index Scan using pk_tbl_p_procedure_id on tbl_procedure pr (cost=0.28..0.30 rows=1 width=40) (actual time=0.008..0.008 rows=1 loops=6)

  • Index Cond: (ap.procedure_id = procedure_id)
15. 0.030 0.030 ↑ 1.0 1 6

Index Scan using pk_tbl_s_scan_id on tbl_scan s (cost=0.14..0.16 rows=1 width=21) (actual time=0.005..0.005 rows=1 loops=6)

  • Index Cond: (pr.scan_id = scan_id)