explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Y6b

Settings
# exclusive inclusive rows x rows loops node
1. 0.048 280,720.623 ↓ 192.0 192 1

Limit (cost=68,537.00..68,539.33 rows=1 width=4,913) (actual time=280,717.998..280,720.623 rows=192 loops=1)

2. 0.456 280,720.575 ↓ 192.0 192 1

Result (cost=68,537.00..68,539.33 rows=1 width=4,913) (actual time=280,717.997..280,720.575 rows=192 loops=1)

3. 0.893 280,717.047 ↓ 192.0 192 1

Sort (cost=68,537.00..68,537.01 rows=1 width=4,905) (actual time=280,717.001..280,717.047 rows=192 loops=1)

  • Sort Key: ehrdata0_.id
  • Sort Method: quicksort Memory: 257kB
4. 0.239 280,716.154 ↓ 192.0 192 1

Nested Loop Semi Join (cost=2.29..68,536.99 rows=1 width=4,905) (actual time=880.600..280,716.154 rows=192 loops=1)

5. 2.197 280,703.243 ↓ 192.0 192 1

Nested Loop (cost=1.86..68,534.61 rows=1 width=4,890) (actual time=879.294..280,703.243 rows=192 loops=1)

6. 1.668 280,388.496 ↓ 127.6 893 1

Nested Loop (cost=1.43..68,517.86 rows=7 width=2,318) (actual time=784.600..280,388.496 rows=893 loops=1)

7. 1.300 280,153.755 ↓ 127.6 893 1

Nested Loop (cost=1.00..68,501.18 rows=7 width=2,317) (actual time=784.081..280,153.755 rows=893 loops=1)

8. 279,858.658 279,858.658 ↓ 446.5 893 1

Index Scan using idx_team_stats_message_count on menu_data ehrdata0_ (cost=0.57..68,493.24 rows=2 width=2,309) (actual time=782.551..279,858.658 rows=893 loops=1)

  • Index Cond: ((datatype = ANY ('{message,encounterEvent}'::menu_data_type[])) AND ((string04)::text = 'UNREAD'::text))
  • Filter: ((NOT deleted) AND (date(persisteddate) = '2019-06-02'::date) AND (((route)::character varying(255))::text = 'HL7_API'::text))
  • Rows Removed by Filter: 2362344
9. 293.797 293.797 ↑ 4.0 1 893

Index Scan using idx_account_user_accountid on account_user accountuse1_ (cost=0.43..3.93 rows=4 width=16) (actual time=0.324..0.329 rows=1 loops=893)

  • Index Cond: (account_id = ehrdata0_.account_id)
  • Filter: defaultaccount
  • Rows Removed by Filter: 0
10. 233.073 233.073 ↑ 1.0 1 893

Index Scan using tolven_user_pkey on tolven_user tolvenuser3_ (cost=0.43..2.38 rows=1 width=17) (actual time=0.261..0.261 rows=1 loops=893)

  • Index Cond: (id = accountuse1_.user_id)
11. 312.550 312.550 ↓ 0.0 0 893

Index Scan using pkbperson_pkey on pkbperson pkbperson2_ (cost=0.43..2.39 rows=1 width=2,572) (actual time=0.350..0.350 rows=0 loops=893)

  • Index Cond: (id = (tolvenuser3_.uid)::bigint)
  • Filter: (((usertype)::text = 'PATIENT'::text) AND ((status)::text = 'EMAIL_CONFIRMED'::text))
  • Rows Removed by Filter: 1
12. 12.672 12.672 ↑ 1.0 1 192

Index Scan using idx_instituteuser_personid on instituteuser instituteu4_ (cost=0.43..2.39 rows=1 width=8) (actual time=0.066..0.066 rows=1 loops=192)

  • Index Cond: (person_id = pkbperson2_.id)
  • Filter: ((sponsorshipstatus)::text = 'ACTIVE'::text)
13.          

SubPlan (forResult)

14. 0.192 3.072 ↓ 0.0 0 192

Limit (cost=2.30..2.31 rows=1 width=24) (actual time=0.016..0.016 rows=0 loops=192)

15. 0.768 2.880 ↓ 0.0 0 192

Sort (cost=2.30..2.31 rows=1 width=24) (actual time=0.015..0.015 rows=0 loops=192)

  • Sort Key: po.change_date DESC
  • Sort Method: quicksort Memory: 25kB
16. 2.112 2.112 ↓ 0.0 0 192

Index Scan using idx_privacy_override_uniqueid on privacy_override po (cost=0.28..2.29 rows=1 width=24) (actual time=0.011..0.011 rows=0 loops=192)

  • Index Cond: ((uniqueid)::text = (ehrdata0_.uniqueid)::text)