explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GgEU

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.235 ↑ 2.0 1 1

Unique (cost=83.70..83.72 rows=2 width=49) (actual time=0.234..0.235 rows=1 loops=1)

2. 0.046 0.234 ↑ 2.0 1 1

Sort (cost=83.70..83.71 rows=2 width=49) (actual time=0.233..0.234 rows=1 loops=1)

  • Sort Key: u.role_id, (CASE WHEN ((u.scheduler_dept_id IS NULL) OR ((u.scheduler_dept_id)::text = ''::text)) THEN COALESCE(d.dept_id, pr.dept_name) ELSE u.scheduler_dept_id END), (COALESCE(pr.center_id, dcm.center_id))
  • Sort Method: quicksort Memory: 25kB
3. 0.003 0.188 ↑ 2.0 1 1

Nested Loop Left Join (cost=7.03..83.69 rows=2 width=49) (actual time=0.184..0.188 rows=1 loops=1)

4. 0.005 0.081 ↑ 2.0 1 1

Nested Loop Left Join (cost=6.59..77.21 rows=2 width=27) (actual time=0.080..0.081 rows=1 loops=1)

5. 0.041 0.041 ↑ 1.0 1 1

Index Scan using u_user_pk on u_user u (cost=0.29..6.30 rows=1 width=17) (actual time=0.041..0.041 rows=1 loops=1)

  • Index Cond: ((emp_username)::text = 'InstaAdmin'::text)
6. 0.023 0.035 ↓ 0.0 0 1

Hash Right Join (cost=6.31..70.89 rows=2 width=20) (actual time=0.035..0.035 rows=0 loops=1)

  • Hash Cond: ((dcm.doctor_id)::text = (d.doctor_id)::text)
7. 0.000 0.000 ↓ 0.0 0

Seq Scan on doctor_center_master dcm (cost=0.00..56.75 rows=2,975 width=12) (never executed)

8. 0.002 0.012 ↓ 0.0 0 1

Hash (cost=6.29..6.29 rows=1 width=16) (actual time=0.012..0.012 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
9. 0.010 0.010 ↓ 0.0 0 1

Index Scan using doctors_pkey on doctors d (cost=0.28..6.29 rows=1 width=16) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: ((doctor_id)::text = (u.doctor_id)::text)
10. 0.007 0.104 ↑ 1.0 1 1

Materialize (cost=0.43..6.46 rows=1 width=12) (actual time=0.102..0.104 rows=1 loops=1)

11. 0.097 0.097 ↑ 1.0 1 1

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.43..6.45 rows=1 width=12) (actual time=0.096..0.097 rows=1 loops=1)

  • Index Cond: ((patient_id)::text = 'A13I19090000001'::text)
Planning time : 10.407 ms
Execution time : 0.440 ms