explain.depesz.com

PostgreSQL's explain analyze made readable

Result: av8q

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 0.126 ↑ 2.0 1 1

Unique (cost=42.40..42.44 rows=2 width=47) (actual time=0.124..0.126 rows=1 loops=1)

2. 0.053 0.121 ↑ 1.0 2 1

Sort (cost=42.40..42.40 rows=2 width=47) (actual time=0.121..0.121 rows=2 loops=1)

  • Sort Key: case_file.created_at, case_file.id, case_file.case_number, case_file.doctor_assigned, case_file.infectious_disease_alert, investigation.deceased_last_name, investigation.deceased_first_name
  • Sort Method: quicksort Memory: 25kB
3. 0.004 0.068 ↑ 1.0 2 1

Nested Loop (cost=1.71..42.39 rows=2 width=47) (actual time=0.050..0.068 rows=2 loops=1)

  • Join Filter: (case_file.id = investigation.case_id)
4. 0.002 0.060 ↑ 1.0 2 1

Nested Loop (cost=1.43..39.65 rows=2 width=50) (actual time=0.046..0.060 rows=2 loops=1)

  • Join Filter: (external_toxicology_study.case_id = case_file.id)
5. 0.013 0.031 ↑ 2.3 3 1

Hash Join (cost=1.16..22.76 rows=7 width=16) (actual time=0.030..0.031 rows=3 loops=1)

  • Hash Cond: (internal_toxicology_study.case_id = external_toxicology_study.case_id)
6. 0.006 0.006 ↑ 418.0 2 1

Seq Scan on internal_toxicology_study (cost=0.00..18.40 rows=836 width=8) (actual time=0.006..0.006 rows=2 loops=1)

  • Filter: (completed_at IS NOT NULL)
7. 0.007 0.012 ↓ 1.3 9 1

Hash (cost=1.07..1.07 rows=7 width=8) (actual time=0.012..0.012 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
8. 0.005 0.005 ↓ 1.3 9 1

Seq Scan on external_toxicology_study (cost=0.00..1.07 rows=7 width=8) (actual time=0.003..0.005 rows=9 loops=1)

9. 0.011 0.027 ↑ 1.0 1 3

Index Scan using case_file_pkey on case_file (cost=0.28..2.40 rows=1 width=34) (actual time=0.009..0.009 rows=1 loops=3)

  • Index Cond: (id = internal_toxicology_study.case_id)
  • Filter: ((NOT toxicology_complete) AND (SubPlan 1))
  • Rows Removed by Filter: 0
10.          

SubPlan (forIndex Scan)

11. 0.006 0.016 ↑ 1.0 1 2

Subquery Scan on alias_92123879 (cost=1.09..1.12 rows=1 width=1) (actual time=0.007..0.008 rows=1 loops=2)

12. 0.006 0.010 ↑ 1.0 1 2

Aggregate (cost=1.09..1.10 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=2)

13. 0.004 0.004 ↓ 2.0 2 2

Seq Scan on external_toxicology_study external_toxicology_study_1 (cost=0.00..1.09 rows=1 width=1) (actual time=0.002..0.002 rows=2 loops=2)

  • Filter: (case_id = case_file.id)
  • Rows Removed by Filter: 7
14. 0.004 0.004 ↑ 1.0 1 2

Index Scan using idx_investigation_investigation_case on investigation (cost=0.28..1.35 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=2)

  • Index Cond: (case_id = internal_toxicology_study.case_id)
Planning time : 2.541 ms
Execution time : 0.258 ms