explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 552I

Settings
# exclusive inclusive rows x rows loops node
1. 0.105 35,791.181 ↓ 1.9 1,000 1

Limit (cost=285,114.72..297,040.57 rows=532 width=13) (actual time=35,688.168..35,791.181 rows=1,000 loops=1)

2. 6.635 35,791.076 ↓ 1.9 1,000 1

Hash Join (cost=285,114.72..297,040.57 rows=532 width=13) (actual time=35,688.166..35,791.076 rows=1,000 loops=1)

  • Hash Cond: ((pre.phone)::text = (c.phone)::text)
  • Join Filter: ((c.last_notified_released < pre."time") OR (c.last_notified_released IS NULL))
  • Rows Removed by Join Filter: 1000
3. 25.277 35,679.765 ↓ 7.6 16,160 1

Subquery Scan on pre (cost=278,800.06..290,252.32 rows=2,127 width=21) (actual time=35,474.348..35,679.765 rows=16,160 loops=1)

  • Filter: (((pre.event_code)::text = 'MAXED'::text) OR ((pre.event_code)::text = 'SOONER'::text))
  • Rows Removed by Filter: 104081
4. 93.288 35,654.488 ↑ 1.8 120,241 1

Unique (cost=278,800.06..287,053.77 rows=213,237 width=26) (actual time=35,474.338..35,654.488 rows=120,241 loops=1)

5. 34,962.965 35,561.200 ↑ 2.3 722,976 1

Sort (cost=278,800.06..282,926.92 rows=1,650,741 width=26) (actual time=35,474.336..35,561.200 rows=722,976 loops=1)

  • Sort Key: event_attempts.phone, event_attempts."time" DESC
  • Sort Method: external sort Disk: 60088kB
6. 598.235 598.235 ↑ 1.0 1,650,741 1

Seq Scan on event_attempts (cost=0.00..29,327.41 rows=1,650,741 width=26) (actual time=0.868..598.235 rows=1,650,741 loops=1)

7. 29.721 104.676 ↑ 1.0 75,287 1

Hash (cost=4,931.56..4,931.56 rows=75,288 width=21) (actual time=104.676..104.676 rows=75,287 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 2189kB
8. 74.955 74.955 ↑ 1.0 75,287 1

Seq Scan on contestants c (cost=0.00..4,931.56 rows=75,288 width=21) (actual time=0.014..74.955 rows=75,287 loops=1)

  • Filter: (active AND (NOT blacklist))
  • Rows Removed by Filter: 224713
Planning time : 0.766 ms
Execution time : 35,796.268 ms