explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5nL2 : 7517 migration query

Settings
# exclusive inclusive rows x rows loops node
1. 14,310.537 27,617.794 ↓ 0.0 0 1

Update on subscribers (cost=97,842.65..306,088.12 rows=921 width=1,269) (actual time=27,617.794..27,617.794 rows=0 loops=1)

2. 46.941 13,307.257 ↓ 25.1 23,133 1

Nested Loop (cost=97,842.65..306,088.12 rows=921 width=1,269) (actual time=11,584.098..13,307.257 rows=23,133 loops=1)

3. 21.103 11,640.726 ↑ 1.1 23,137 1

Subquery Scan on events (cost=97,842.08..98,278.40 rows=24,930 width=48) (actual time=11,582.760..11,640.726 rows=23,137 loops=1)

4. 19.211 11,619.623 ↑ 1.1 23,137 1

Unique (cost=97,842.08..98,029.10 rows=24,930 width=12) (actual time=11,582.734..11,619.623 rows=23,137 loops=1)

5. 48.253 11,600.412 ↑ 1.1 23,469 1

Sort (cost=97,842.08..97,904.42 rows=24,935 width=12) (actual time=11,582.732..11,600.412 rows=23,469 loops=1)

  • Sort Key: mailgun_events.subscriber_id, mailgun_events.occurred_at DESC
  • Sort Method: quicksort Memory: 1,869kB
6. 11,509.435 11,552.159 ↑ 1.1 23,469 1

Bitmap Heap Scan on mailgun_events (cost=581.81..96,021.10 rows=24,935 width=12) (actual time=46.235..11,552.159 rows=23,469 loops=1)

  • Recheck Cond: ((store_id = 7,517) AND ((event)::text = 'opened'::text))
  • Heap Blocks: exact=15,069
7. 42.724 42.724 ↑ 1.1 23,469 1

Bitmap Index Scan on mg_partial_opened (cost=0.00..575.58 rows=24,935 width=0) (actual time=42.724..42.724 rows=23,469 loops=1)

  • Index Cond: (store_id = 7,517)
8. 1,619.590 1,619.590 ↑ 1.0 1 23,137

Index Scan using subscribers_pkey on subscribers (cost=0.56..8.34 rows=1 width=1,225) (actual time=0.070..0.070 rows=1 loops=23,137)

  • Index Cond: (id = events.subscriber_id)
  • Filter: (store_id = 7,517)
Planning time : 0.686 ms
Execution time : 27,617.938 ms