explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YEUb

Settings
# exclusive inclusive rows x rows loops node
1. 0.075 2,687.827 ↑ 1.0 1 1

Aggregate (cost=33,021.90..33,021.91 rows=1 width=8) (actual time=2,687.827..2,687.827 rows=1 loops=1)

2. 0.661 2,687.752 ↓ 29.0 29 1

Nested Loop (cost=224.02..33,021.90 rows=1 width=0) (actual time=513.176..2,687.752 rows=29 loops=1)

3. 1.243 1.243 ↑ 3.3 44 1

Index Scan using message_type_359c46_idx on message (cost=0.43..17.40 rows=145 width=4) (actual time=0.140..1.243 rows=44 loops=1)

  • Index Cond: (type = 2)
  • Filter: (send_datetime IS NOT NULL)
4. 143.792 2,685.848 ↑ 1.0 1 44

Bitmap Heap Scan on message_recipient (cost=223.59..227.61 rows=1 width=4) (actual time=60.261..61.042 rows=1 loops=44)

  • Recheck Cond: ((message_id = message.id) AND (to_user_id = 5987))
  • Rows Removed by Index Recheck: 920
  • Filter: ((NOT deleted) AND (NOT read) AND (read_datetime IS NULL))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=15232
5. 63.316 2,542.056 ↓ 0.0 0 44

BitmapAnd (cost=223.59..223.59 rows=1 width=0) (actual time=57.774..57.774 rows=0 loops=44)

6. 52.052 52.052 ↓ 12.6 12,052 44

Bitmap Index Scan on message_recipient_message_id (cost=0.00..19.72 rows=954 width=0) (actual time=1.183..1.183 rows=12,052 loops=44)

  • Index Cond: (message_id = message.id)
7. 2,426.688 2,426.688 ↓ 23.8 255,995 44

Bitmap Index Scan on message_recipient_to_user_id (cost=0.00..201.25 rows=10,758 width=0) (actual time=55.152..55.152 rows=255,995 loops=44)

  • Index Cond: (to_user_id = 5987)
Planning time : 2.628 ms
Execution time : 2,688.018 ms