explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Cg0 : biggest store update after setting null

Settings
# exclusive inclusive rows x rows loops node
1. 2,667.946 14,335.331 ↓ 0.0 0 1

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

2. 23.479 11,667.385 ↓ 25.1 23,133 1

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

3. 9.131 11,181.166 ↑ 1.1 23,137 1

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

4. 9.836 11,172.035 ↑ 1.1 23,137 1

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

5. 45.808 11,162.199 ↑ 1.1 23,469 1

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

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

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

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

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

  • Index Cond: (store_id = 7,517)
8. 462.740 462.740 ↑ 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.020..0.020 rows=1 loops=23,137)

  • Index Cond: (id = events.subscriber_id)
  • Filter: (store_id = 7,517)
Planning time : 0.600 ms
Execution time : 14,335.480 ms