explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xOCs

Settings
# exclusive inclusive rows x rows loops node
1. 0.119 150.476 ↓ 2.1 667 1

Nested Loop (cost=82,707.32..84,659.51 rows=320 width=72) (actual time=142.212..150.476 rows=667 loops=1)

2. 0.000 143.577 ↓ 2.1 678 1

Finalize GroupAggregate (cost=82,706.62..82,869.48 rows=320 width=40) (actual time=142.175..143.577 rows=678 loops=1)

  • Group Key: message.fwd_channel_id
3. 0.000 143.865 ↓ 1.2 1,476 1

Gather Merge (cost=82,706.62..82,859.88 rows=1,280 width=40) (actual time=142.168..143.865 rows=1,476 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
4. 0.575 682.725 ↑ 1.1 295 5

Sort (cost=81,706.56..81,707.36 rows=320 width=40) (actual time=136.523..136.545 rows=295 loops=5)

  • Sort Key: message.fwd_channel_id
  • Sort Method: quicksort Memory: 44kB
  • Worker 0: Sort Method: quicksort Memory: 48kB
  • Worker 1: Sort Method: quicksort Memory: 42kB
  • Worker 2: Sort Method: quicksort Memory: 49kB
  • Worker 3: Sort Method: quicksort Memory: 50kB
5. 4.820 682.150 ↑ 1.1 295 5

Partial HashAggregate (cost=81,690.05..81,693.25 rows=320 width=40) (actual time=136.365..136.430 rows=295 loops=5)

  • Group Key: message.fwd_channel_id
6. 18.180 677.330 ↑ 11.1 3,029 5

Hash Anti Join (cost=45.81..81,521.54 rows=33,702 width=25) (actual time=1.940..135.466 rows=3,029 loops=5)

  • Hash Cond: (message.fwd_channel_id = channel.tg_id)
7. 656.575 656.575 ↑ 1.3 27,042 5

Parallel Seq Scan on message (cost=0.00..81,044.60 rows=35,206 width=25) (actual time=0.079..131.315 rows=27,042 loops=5)

  • Filter: (fwd_channel_post IS NOT NULL)
  • Rows Removed by Filter: 632045
8. 0.900 2.575 ↑ 1.0 832 5

Hash (cost=35.36..35.36 rows=836 width=8) (actual time=0.515..0.515 rows=832 loops=5)

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
9. 1.675 1.675 ↑ 1.0 836 5

Seq Scan on channel (cost=0.00..35.36 rows=836 width=8) (actual time=0.026..0.335 rows=836 loops=5)

10. 0.678 6.780 ↑ 1.0 1 678

Limit (cost=0.71..5.56 rows=1 width=32) (actual time=0.009..0.010 rows=1 loops=678)

11. 1.626 6.102 ↑ 413.0 1 678

Nested Loop (cost=0.71..2,007.41 rows=413 width=32) (actual time=0.009..0.009 rows=1 loops=678)

12. 2.712 2.712 ↑ 440.0 1 678

Index Scan using channel_fwd_channel_id_idx on message message_1 (cost=0.43..1,745.85 rows=440 width=16) (actual time=0.004..0.004 rows=1 loops=678)

  • Index Cond: (fwd_channel_id = message.fwd_channel_id)
13. 1.764 1.764 ↑ 1.0 1 882

Index Scan using channel_tg_id_idx on channel channel_1 (cost=0.28..0.58 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=882)

  • Index Cond: (tg_id = message_1.channel_id)
  • Filter: (username IS NOT NULL)
  • Rows Removed by Filter: 0