explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fPMV

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=64,481.43..64,482.01 rows=1 width=2,188) (actual rows= loops=)

2.          

Initplan (forLimit)

3. 0.000 0.000 ↓ 0.0

Index Scan using ae_ae_title_idx on application_entities ae (cost=0.14..8.17 rows=1 width=32) (actual rows= loops=)

  • Index Cond: ((ae_title)::text = 'ae_title_1'::text)
  • Filter: ((NOT has_deleted) AND is_active AND ('MODALITY WORKLIST'::text = ANY ((ae_types)::text[])))
4. 0.000 0.000 ↓ 0.0

Result (cost=64,473.26..64,473.84 rows=1 width=2,188) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Sort (cost=64,473.26..64,473.26 rows=1 width=2,181) (actual rows= loops=)

  • Sort Key: studies.study_dt DESC
6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.54..64,473.25 rows=1 width=2,181) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.26..64,464.90 rows=1 width=1,918) (actual rows= loops=)

  • Join Filter: (application_entities.id = ANY (mr2.application_entity_id))
  • Filter: (COALESCE(modality_rooms.id, 0) = COALESCE(mr2.id, COALESCE(modality_rooms.id, 0)))
8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.26..64,461.57 rows=1 width=1,926) (actual rows= loops=)

  • Join Filter: (modality_rooms.id = orders.modality_room_id)
  • Filter: (application_entities.id = ANY (COALESCE(NULLIF(modality_rooms.application_entity_id, '{NULL}'::bigint[]), (ARRAY[application_entities.id])::bigint[])))
9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.26..64,458.05 rows=1 width=1,926) (actual rows= loops=)

  • Join Filter: (studies.facility_id = facilities.id)
10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.26..64,452.71 rows=1 width=1,752) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.84..64,444.28 rows=1 width=1,092) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..64,435.84 rows=1 width=168) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..64,431.39 rows=1 width=168) (actual rows= loops=)

  • Join Filter: (studies.facility_id = ANY (application_entities.facilities))
14. 0.000 0.000 ↓ 0.0

Seq Scan on application_entities (cost=0.00..8.85 rows=1 width=39) (actual rows= loops=)

  • Filter: (((COALESCE(ae_title, 'ae_title_1'::character varying))::text = 'ae_title_1'::text) AND ('MODALITY WORKLIST'::text = ANY ((ae_types)::text[])))
15. 0.000 0.000 ↓ 0.0

Seq Scan on studies (cost=0.00..64,422.43 rows=5 width=162) (actual rows= loops=)

  • Filter: (((study_status)::text = ANY ('{CHI,ASAC,TS}'::text[])) AND (string_to_array((modalities)::text, ', '::text) && $1) AND (COALESCE(NULLIF((dicom_status)::text, ''::text), 'NA'::text (...)
16. 0.000 0.000 ↓ 0.0

Index Only Scan using study_id_idx on study_cpt (cost=0.42..4.44 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (study_id = studies.id)
17. 0.000 0.000 ↓ 0.0

Index Scan using pk_patients on patients (cost=0.42..8.44 rows=1 width=940) (actual rows= loops=)

  • Index Cond: (id = studies.patient_id)
18. 0.000 0.000 ↓ 0.0

Index Scan using pk_orders on orders (cost=0.42..8.44 rows=1 width=676) (actual rows= loops=)

  • Index Cond: (id = studies.order_id)
19. 0.000 0.000 ↓ 0.0

Seq Scan on facilities (cost=0.00..5.15 rows=15 width=182) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on modality_rooms (cost=0.00..2.38 rows=38 width=36) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on modality_rooms mr2 (cost=0.00..2.38 rows=38 width=36) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using pk_providers on providers (cost=0.28..8.30 rows=1 width=17) (actual rows= loops=)

  • Index Cond: (id = studies.reading_physician_id)
23.          

SubPlan (forResult)

24. 0.000 0.000 ↓ 0.0

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=0) (actual rows= loops=)