explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EaOo

Settings
# exclusive inclusive rows x rows loops node
1. 0.014 2.214 ↓ 5.0 10 1

Hash Left Join (cost=175.57..190.61 rows=2 width=816) (actual time=2.191..2.214 rows=10 loops=1)

  • Hash Cond: ((wacl.treatment_id)::text = (wb.treatment_id)::text)
  • Filter: ((wacl.* IS NULL) OR (NOT wb.deleted))
2. 0.000 2.188 ↓ 2.5 10 1

Nested Loop Left Join (cost=174.17..189.15 rows=4 width=1,208) (actual time=2.167..2.188 rows=10 loops=1)

3. 0.018 2.168 ↓ 2.5 10 1

Hash Right Join (cost=174.03..188.46 rows=4 width=853) (actual time=2.163..2.168 rows=10 loops=1)

  • Hash Cond: ((ifre.medical_case_id)::text = (imc.id)::text)
  • Filter: ((ifre.* IS NULL) OR ((ifre.* IS NOT NULL) AND ((mc.status)::text = 'ACTIVE'::text)))
4. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on inpat_fin_rep_errors ifre (cost=0.00..13.20 rows=320 width=334) (actual time=0.000..0.000 rows=0 loops=1)

5. 0.012 2.150 ↓ 2.0 10 1

Hash (cost=173.97..173.97 rows=5 width=890) (actual time=2.150..2.150 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
6. 0.002 2.138 ↓ 2.0 10 1

Nested Loop (cost=153.83..173.97 rows=5 width=890) (actual time=2.017..2.138 rows=10 loops=1)

7. 0.007 2.076 ↓ 2.0 10 1

Nested Loop (cost=153.55..171.88 rows=5 width=853) (actual time=2.008..2.076 rows=10 loops=1)

8. 0.023 2.009 ↓ 2.0 10 1

Hash Left Join (cost=153.27..168.61 rows=5 width=837) (actual time=1.997..2.009 rows=10 loops=1)

  • Hash Cond: ((dml.diet_assignment_id)::text = (da.id)::text)
  • Filter: ((da.* IS NULL) OR da.present)
  • Rows Removed by Filter: 2
9. 0.024 1.968 ↓ 1.2 12 1

Hash Right Join (cost=151.89..167.18 rows=10 width=836) (actual time=1.958..1.968 rows=12 loops=1)

  • Hash Cond: ((dml.medical_case_id)::text = (imc.id)::text)
10. 0.002 0.002 ↑ 25.3 15 1

Seq Scan on dias_meca_link dml (cost=0.00..13.80 rows=380 width=180) (actual time=0.001..0.002 rows=15 loops=1)

11. 0.021 1.942 ↑ 1.0 10 1

Hash (cost=151.77..151.77 rows=10 width=746) (actual time=1.942..1.942 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
12. 0.028 1.921 ↑ 1.0 10 1

Nested Loop (cost=21.30..151.77 rows=10 width=746) (actual time=0.827..1.921 rows=10 loops=1)

13. 0.359 1.725 ↓ 1.1 28 1

Hash Join (cost=21.02..143.02 rows=25 width=709) (actual time=0.781..1.725 rows=28 loops=1)

  • Hash Cond: ((mc.attendant_organization_id)::text = (mu.id)::text)
14. 1.184 1.184 ↑ 1.0 1,399 1

Seq Scan on medical_cases mc (cost=0.00..116.40 rows=1,425 width=664) (actual time=0.006..1.184 rows=1,399 loops=1)

  • Filter: ((NOT deleted) AND (((status)::text = ANY ('{ACTIVE,DISCHARGED}'::text[])) OR (((status)::text = 'CLOSED'::text) AND (close_date >= '2019-01-07 00:00:00'::timestamp without time zone) AND (close_date <= '2019-01-08 00:00:00'::timestamp without time zone))))
  • Rows Removed by Filter: 256
15. 0.002 0.182 ↑ 1.2 6 1

Hash (cost=20.94..20.94 rows=7 width=45) (actual time=0.182..0.182 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
16. 0.180 0.180 ↑ 1.2 6 1

Seq Scan on medical_units mu (cost=0.00..20.94 rows=7 width=45) (actual time=0.006..0.180 rows=6 loops=1)

  • Filter: ((special_medical_unit_type)::text = 'EMERGENCY'::text)
  • Rows Removed by Filter: 353
17. 0.168 0.168 ↓ 0.0 0 28

Index Only Scan using in_patient_medical_cases_pkey on inpatient_medical_cases imc (cost=0.28..0.34 rows=1 width=37) (actual time=0.006..0.006 rows=0 loops=28)

  • Index Cond: (id = (mc.id)::text)
  • Heap Fetches: 10
18. 0.010 0.018 ↑ 1.0 17 1

Hash (cost=1.17..1.17 rows=17 width=942) (actual time=0.018..0.018 rows=17 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
19. 0.008 0.008 ↑ 1.0 17 1

Seq Scan on diet_assignments da (cost=0.00..1.17 rows=17 width=942) (actual time=0.005..0.008 rows=17 loops=1)

20. 0.060 0.060 ↑ 1.0 1 10

Index Scan using patients_pkey on patients pat (cost=0.28..0.65 rows=1 width=53) (actual time=0.006..0.006 rows=1 loops=10)

  • Index Cond: ((id)::text = (mc.patient_id)::text)
21. 0.060 0.060 ↑ 1.0 1 10

Index Only Scan using attendance_chain_pk on attendance_chain ac (cost=0.28..0.41 rows=1 width=37) (actual time=0.006..0.006 rows=1 loops=10)

  • Index Cond: (id = (mc.attendance_chain_id)::text)
  • Heap Fetches: 10
22. 0.020 0.020 ↓ 0.0 0 10

Index Scan using wristband_attendance_chain_links_uk on wristband_attendance_chain_links wacl (cost=0.14..0.16 rows=1 width=482) (actual time=0.002..0.002 rows=0 loops=10)

  • Index Cond: ((attendance_chain_key)::text = (ac.id)::text)
23. 0.004 0.012 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=91) (actual time=0.012..0.012 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
24. 0.008 0.008 ↑ 1.0 18 1

Seq Scan on wristbands wb (cost=0.00..1.18 rows=18 width=91) (actual time=0.006..0.008 rows=18 loops=1)