explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rbFd

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 11,755.247 ↓ 98.0 98 1

Limit (cost=217,237.40..217,237.41 rows=1 width=128) (actual time=11,755.202..11,755.247 rows=98 loops=1)

2. 0.389 11,755.227 ↓ 98.0 98 1

Sort (cost=217,237.40..217,237.41 rows=1 width=128) (actual time=11,755.200..11,755.227 rows=98 loops=1)

  • Sort Key: communication_emailevent."timestamp" DESC
  • Sort Method: quicksort Memory: 38kB
3. 0.205 11,754.838 ↓ 98.0 98 1

Nested Loop Left Join (cost=1,301.16..217,237.39 rows=1 width=128) (actual time=11,728.687..11,754.838 rows=98 loops=1)

4. 1.467 11,740.619 ↓ 98.0 98 1

Nested Loop (cost=1,300.73..217,228.94 rows=1 width=74) (actual time=11,727.819..11,740.619 rows=98 loops=1)

  • Join Filter: (communication_communicationprocess.owner_id = user_profile_advisoraccount.id)
  • Rows Removed by Join Filter: 4704
5. 0.074 13.795 ↓ 3.8 49 1

Nested Loop (cost=0.56..547.26 rows=13 width=4) (actual time=1.927..13.795 rows=49 loops=1)

6. 0.126 10.242 ↓ 3.8 49 1

Nested Loop (cost=0.28..501.93 rows=13 width=12) (actual time=1.887..10.242 rows=49 loops=1)

7. 6.980 6.980 ↓ 3.8 49 1

Seq Scan on auth_user_groups (cost=0.00..413.90 rows=13 width=4) (actual time=1.860..6.980 rows=49 loops=1)

  • Filter: (group_id = 10)
  • Rows Removed by Filter: 23063
8. 3.136 3.136 ↑ 1.0 1 49

Index Scan using user_profile_advisoraccount_user_id_key on user_profile_advisoraccount (cost=0.28..6.76 rows=1 width=8) (actual time=0.064..0.064 rows=1 loops=49)

  • Index Cond: (user_id = auth_user_groups.user_id)
9. 3.479 3.479 ↑ 1.0 1 49

Index Only Scan using auth_user_pkey on auth_user (cost=0.28..3.48 rows=1 width=4) (actual time=0.070..0.071 rows=1 loops=49)

  • Index Cond: (id = user_profile_advisoraccount.user_id)
  • Heap Fetches: 49
10. 0.547 11,725.357 ↓ 98.0 98 49

Materialize (cost=1,300.17..216,681.49 rows=1 width=78) (actual time=130.528..239.293 rows=98 loops=49)

11. 0.153 11,724.810 ↓ 98.0 98 1

Nested Loop (cost=1,300.17..216,681.48 rows=1 width=78) (actual time=6,395.847..11,724.810 rows=98 loops=1)

12. 11,642.100 11,706.919 ↓ 98.0 98 1

Bitmap Heap Scan on communication_emailevent (cost=1,299.74..216,673.03 rows=1 width=74) (actual time=6,395.185..11,706.919 rows=98 loops=1)

  • Recheck Cond: ((event)::text = 'P'::text)
  • Rows Removed by Index Recheck: 3579345
  • Filter: (("timestamp" >= '2017-12-01 12:46:00-05'::timestamp with time zone) AND ((info)::text = 'G'::text))
  • Rows Removed by Filter: 99330
  • Heap Blocks: exact=28783 lossy=55574
13. 64.819 64.819 ↓ 1.4 99,520 1

Bitmap Index Scan on communication_emailevent_event_da0e221f_uniq (cost=0.00..1,299.74 rows=70,290 width=0) (actual time=64.819..64.819 rows=99,520 loops=1)

  • Index Cond: ((event)::text = 'P'::text)
14. 17.738 17.738 ↑ 1.0 1 98

Index Scan using communication_communicationprocess_pkey on communication_communicationprocess (cost=0.42..8.44 rows=1 width=8) (actual time=0.180..0.181 rows=1 loops=98)

  • Index Cond: (process_ptr_id = communication_emailevent.process_id)
15. 14.014 14.014 ↑ 1.0 1 98

Index Scan using contact_contact_pkey on contact_contact (cost=0.43..8.45 rows=1 width=54) (actual time=0.141..0.143 rows=1 loops=98)

  • Index Cond: (communication_emailevent.recipient_id = id)