explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NVXM

Settings
# exclusive inclusive rows x rows loops node
1. 1.744 175,909.298 ↓ 2.1 667 1

Nested Loop (cost=82,722.14..171,357.45 rows=320 width=72) (actual time=535.850..175,909.298 rows=667 loops=1)

2. 3.099 149.614 ↓ 2.1 678 1

Finalize GroupAggregate (cost=82,721.87..82,884.73 rows=320 width=40) (actual time=144.880..149.614 rows=678 loops=1)

  • Group Key: message.fwd_channel_id
3. 0.000 146.515 ↓ 1.2 1,496 1

Gather Merge (cost=82,721.87..82,875.13 rows=1,280 width=40) (actual time=144.874..146.515 rows=1,496 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
4. 0.795 697.115 ↑ 1.1 299 5

Sort (cost=81,721.81..81,722.61 rows=320 width=40) (actual time=139.365..139.423 rows=299 loops=5)

  • Sort Key: message.fwd_channel_id
  • Sort Method: quicksort Memory: 44kB
  • Worker 0: Sort Method: quicksort Memory: 41kB
  • Worker 1: Sort Method: quicksort Memory: 50kB
  • Worker 2: Sort Method: quicksort Memory: 48kB
  • Worker 3: Sort Method: quicksort Memory: 50kB
5. 4.940 696.320 ↑ 1.1 299 5

Partial HashAggregate (cost=81,705.30..81,708.50 rows=320 width=40) (actual time=139.196..139.264 rows=299 loops=5)

  • Group Key: message.fwd_channel_id
6. 18.855 691.380 ↑ 11.1 3,029 5

Hash Anti Join (cost=45.81..81,536.48 rows=33,764 width=25) (actual time=3.385..138.276 rows=3,029 loops=5)

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

Parallel Seq Scan on message (cost=0.00..81,058.74 rows=35,271 width=25) (actual time=0.087..133.856 rows=27,042 loops=5)

  • Filter: (fwd_channel_post IS NOT NULL)
  • Rows Removed by Filter: 632038
8. 1.145 3.245 ↑ 1.0 832 5

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

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

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

10. 1.356 175,757.940 ↑ 1.0 1 678

Limit (cost=0.28..276.45 rows=1 width=32) (actual time=259.229..259.230 rows=1 loops=678)

11. 7.860 175,756.584 ↑ 414.0 1 678

Nested Loop (cost=0.28..114,335.59 rows=414 width=32) (actual time=259.228..259.228 rows=1 loops=678)

12. 175,741.668 175,741.668 ↑ 441.0 1 678

Seq Scan on message message_1 (cost=0.00..114,073.73 rows=441 width=16) (actual time=255.386..259.206 rows=1 loops=678)

  • Filter: (fwd_channel_id = message.fwd_channel_id)
  • Rows Removed by Filter: 2007595
13. 7.056 7.056 ↑ 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.008..0.008 rows=1 loops=882)

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