explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DZXB

Settings
# exclusive inclusive rows x rows loops node
1. 2,884.704 16,382.470 ↓ 0.0 0 1

Update on persons (cost=148,968.97..215,934.16 rows=8,315 width=372) (actual time=16,382.469..16,382.470 rows=0 loops=1)

2. 31.136 13,497.766 ↓ 1.8 14,681 1

Nested Loop (cost=148,968.97..215,934.16 rows=8,315 width=372) (actual time=9,093.586..13,497.766 rows=14,681 loops=1)

3. 14.042 9,121.054 ↓ 1.8 14,681 1

Subquery Scan on person_counts (cost=148,968.53..149,134.83 rows=8,315 width=48) (actual time=9,093.531..9,121.054 rows=14,681 loops=1)

4. 239.566 9,107.012 ↓ 1.8 14,681 1

HashAggregate (cost=148,968.53..149,051.68 rows=8,315 width=12) (actual time=9,093.510..9,107.012 rows=14,681 loops=1)

  • Group Key: emails_persons.person_id
5. 8,867.446 8,867.446 ↓ 1.0 677,578 1

Seq Scan on emails_persons (cost=0.00..145,643.40 rows=665,026 width=4) (actual time=1.165..8,867.446 rows=677,578 loops=1)

  • Filter: (email_date > '2018-09-30 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 5425528
6. 4,345.576 4,345.576 ↑ 1.0 1 14,681

Index Scan using persons_pkey on persons (cost=0.43..8.03 rows=1 width=332) (actual time=0.296..0.296 rows=1 loops=14,681)

  • Index Cond: (id = person_counts.pid)