explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JlCY

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 861,611.575 ↑ 21.0 1 1

Limit (cost=861,126.95..861,127.79 rows=21 width=106) (actual time=861,611.571..861,611.575 rows=1 loops=1)

2. 0.006 861,611.569 ↑ 21.0 1 1

Unique (cost=861,126.95..861,127.79 rows=21 width=106) (actual time=861,611.567..861,611.569 rows=1 loops=1)

3. 0.203 861,611.563 ↑ 21.0 1 1

Sort (cost=861,126.95..861,127.00 rows=21 width=106) (actual time=861,611.562..861,611.563 rows=1 loops=1)

  • Sort Key: t0.message_date, t0.clinical_message_key, t0.created_on, t0.event_type, t0.message_control_id, t0.processing_id, t0.received_date, t0.receiving_application, t0.sending_application, t0.updated_on, t0.clinical_message_type_key, t0.source_key, t0.subject_key, t0.subject_alias_key
  • Sort Method: quicksort Memory: 25kB
4. 0.019 861,611.360 ↑ 21.0 1 1

Nested Loop (cost=935.74..861,126.49 rows=21 width=106) (actual time=9,211.248..861,611.360 rows=1 loops=1)

5. 27.786 27.786 ↑ 1.0 1 1

Index Only Scan using clinical_item_pk on clinical_item t3 (cost=0.57..8.59 rows=1 width=9) (actual time=27.782..27.786 rows=1 loops=1)

  • Index Cond: (clinical_item_key = 1065764292::numeric)
  • Heap Fetches: 1
6. 0.021 861,583.555 ↑ 21.0 1 1

Nested Loop (cost=935.17..861,117.69 rows=21 width=115) (actual time=9,183.450..861,583.555 rows=1 loops=1)

7. 484.151 861,583.512 ↑ 1,168.0 1 1

Hash Join (cost=934.60..855,313.70 rows=1,168 width=133) (actual time=9,183.412..861,583.512 rows=1 loops=1)

  • Hash Cond: (t4.clinical_message_key = t0.clinical_message_key)
8. 1,056.687 861,074.617 ↑ 6.5 234,951 1

Nested Loop (cost=1.27..848,673.79 rows=1,521,754 width=27) (actual time=32.978..861,074.617 rows=234,951 loops=1)

9. 365,294.785 365,294.785 ↓ 4.8 71,751 1

Index Scan using clin_item_prov_provider_fki on clinical_item_provider t1 (cost=0.57..36,104.22 rows=14,814 width=9) (actual time=20.903..365,294.785 rows=71,751 loops=1)

  • Index Cond: (provider_key = 152765::numeric)
10. 494,723.145 494,723.145 ↑ 34.3 3 71,751

Index Only Scan using clinical_item_clinical_msg_pk on clinical_item_clinical_message t4 (cost=0.70..53.82 rows=103 width=18) (actual time=6.363..6.895 rows=3 loops=71,751)

  • Index Cond: (clinical_item_key = t1.clinical_item_key)
  • Heap Fetches: 7233
11. 0.020 24.744 ↑ 102.0 1 1

Hash (cost=932.05..932.05 rows=102 width=124) (actual time=24.744..24.744 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
12. 0.022 24.724 ↑ 102.0 1 1

Nested Loop (cost=1.27..932.05 rows=102 width=124) (actual time=24.713..24.724 rows=1 loops=1)

13. 12.970 12.970 ↑ 102.0 1 1

Index Only Scan using clinical_item_clinical_msg_pk on clinical_item_clinical_message t5 (cost=0.70..54.60 rows=102 width=18) (actual time=12.967..12.970 rows=1 loops=1)

  • Index Cond: (clinical_item_key = 1065764292::numeric)
  • Heap Fetches: 1
14. 11.732 11.732 ↑ 1.0 1 1

Index Scan using clinical_message_pk on clinical_message t0 (cost=0.57..8.59 rows=1 width=106) (actual time=11.728..11.732 rows=1 loops=1)

  • Index Cond: (clinical_message_key = t5.clinical_message_key)
  • Filter: (site_key = 3::numeric)
15. 0.022 0.022 ↑ 1.0 1 1

Index Only Scan using clinical_item_pk on clinical_item t2 (cost=0.57..4.96 rows=1 width=9) (actual time=0.021..0.022 rows=1 loops=1)

  • Index Cond: (clinical_item_key = t4.clinical_item_key)
  • Heap Fetches: 1