explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8SHx

Settings
# exclusive inclusive rows x rows loops node
1. 0.286 3.537 ↑ 1.0 1 1

Aggregate (cost=810.93..810.94 rows=1 width=8) (actual time=3.537..3.537 rows=1 loops=1)

2. 0.309 3.251 ↑ 1.0 1,330 1

Hash Right Join (cost=449.23..807.53 rows=1,360 width=0) (actual time=2.561..3.251 rows=1,330 loops=1)

  • Hash Cond: (sp.patient_id = patient.patient_id)
3. 0.021 0.401 ↓ 1.8 20 1

Nested Loop (cost=0.28..358.43 rows=11 width=16) (actual time=0.014..0.401 rows=20 loops=1)

4. 0.340 0.340 ↓ 1.8 20 1

Seq Scan on surgical_plans sp (cost=0.00..279.18 rows=11 width=32) (actual time=0.004..0.340 rows=20 loops=1)

  • Filter: (plan_status_selection = 'approved'::text)
  • Rows Removed by Filter: 1,258
5. 0.040 0.040 ↑ 1.0 1 20

Index Only Scan using case_details_pkey on case_details cd (cost=0.28..7.20 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=20)

  • Index Cond: (id = sp.case_details_fk)
  • Heap Fetches: 20
6. 0.422 2.541 ↑ 1.0 1,330 1

Hash (cost=431.95..431.95 rows=1,360 width=16) (actual time=2.541..2.541 rows=1,330 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 79kB
7. 0.732 2.119 ↑ 1.0 1,330 1

Hash Right Join (cost=306.77..431.95 rows=1,360 width=16) (actual time=0.986..2.119 rows=1,330 loops=1)

  • Hash Cond: (case_details.patient_id = patient.patient_id)
8. 0.410 0.410 ↑ 1.0 1,330 1

Seq Scan on case_details (cost=0.00..121.60 rows=1,360 width=16) (actual time=0.002..0.410 rows=1,330 loops=1)

9. 0.413 0.977 ↑ 1.0 1,315 1

Hash (cost=290.23..290.23 rows=1,323 width=16) (actual time=0.977..0.977 rows=1,315 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 78kB
10. 0.564 0.564 ↑ 1.0 1,315 1

Seq Scan on patient (cost=0.00..290.23 rows=1,323 width=16) (actual time=0.004..0.564 rows=1,315 loops=1)

Planning time : 0.396 ms
Execution time : 3.598 ms