explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0d1

Settings
# exclusive inclusive rows x rows loops node
1. 0.744 5,631.507 ↑ 1.0 1 1

Aggregate (cost=783,730.02..783,730.03 rows=1 width=8) (actual time=5,631.506..5,631.507 rows=1 loops=1)

2. 7.343 5,630.763 ↑ 40.0 8,472 1

Hash Join (cost=63,711.88..782,881.86 rows=339,264 width=0) (actual time=5,505.125..5,630.763 rows=8,472 loops=1)

  • Hash Cond: (message_recipient.message_id = message.id)
3. 5,104.639 5,104.639 ↑ 40.0 8,472 1

Seq Scan on message_recipient (cost=0.00..714,505.10 rows=339,264 width=4) (actual time=4,984.048..5,104.639 rows=8,472 loops=1)

  • Filter: ((NOT deleted) AND (NOT read) AND (read_datetime IS NULL) AND (to_user_id = 3,710))
  • Rows Removed by Filter: 39,565,392
4. 216.963 518.781 ↑ 1.0 912,140 1

Hash (cost=52,306.94..52,306.94 rows=912,395 width=4) (actual time=518.781..518.781 rows=912,140 loops=1)

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 40,260kB
5. 301.818 301.818 ↑ 1.0 912,140 1

Seq Scan on message (cost=0.00..52,306.94 rows=912,395 width=4) (actual time=0.043..301.818 rows=912,140 loops=1)

  • Filter: ((send_datetime IS NOT NULL) AND (type = 1))
  • Rows Removed by Filter: 5
Planning time : 0.315 ms
Execution time : 5,631.940 ms