explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oOcx

Settings
# exclusive inclusive rows x rows loops node
1. 0.510 43.789 ↓ 2.1 667 1

Nested Loop (cost=78,045.70..79,997.88 rows=320 width=72) (actual time=37.435..43.789 rows=667 loops=1)

2. 0.392 38.533 ↓ 2.1 678 1

Finalize GroupAggregate (cost=78,044.99..78,207.86 rows=320 width=40) (actual time=37.399..38.533 rows=678 loops=1)

  • Group Key: message.fwd_channel_id
3. 0.000 38.141 ↓ 1.2 1,505 1

Gather Merge (cost=78,044.99..78,198.26 rows=1,280 width=40) (actual time=37.391..38.141 rows=1,505 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
4. 0.735 154.350 ↑ 1.1 301 5

Sort (cost=77,044.94..77,045.74 rows=320 width=40) (actual time=30.843..30.870 rows=301 loops=5)

  • Sort Key: message.fwd_channel_id
  • Sort Method: quicksort Memory: 50kB
  • Worker 0: Sort Method: quicksort Memory: 44kB
  • Worker 1: Sort Method: quicksort Memory: 45kB
  • Worker 2: Sort Method: quicksort Memory: 44kB
  • Worker 3: Sort Method: quicksort Memory: 51kB
5. 6.030 153.615 ↑ 1.1 301 5

Partial HashAggregate (cost=77,028.42..77,031.62 rows=320 width=40) (actual time=30.641..30.723 rows=301 loops=5)

  • Group Key: message.fwd_channel_id
6. 40.655 147.585 ↑ 11.1 3,029 5

Hash Anti Join (cost=2,685.63..76,859.91 rows=33,702 width=25) (actual time=9.153..29.517 rows=3,029 loops=5)

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

Parallel Bitmap Heap Scan on message (cost=2,639.82..76,382.97 rows=35,206 width=25) (actual time=8.648..20.988 rows=27,042 loops=5)

  • Recheck Cond: (fwd_channel_id IS NOT NULL)
  • Heap Blocks: exact=3108
8. 12.989 12.989 ↑ 1.0 135,212 1

Bitmap Index Scan on channel_fwd_channel_id_idx (cost=0.00..2,604.62 rows=140,825 width=0) (actual time=12.989..12.989 rows=135,212 loops=1)

  • Index Cond: (fwd_channel_id IS NOT NULL)
9. 0.735 1.990 ↑ 1.0 832 5

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

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
10. 1.255 1.255 ↑ 1.0 836 5

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

11. 0.000 4.746 ↑ 1.0 1 678

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

12. 0.948 4.746 ↑ 413.0 1 678

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

13. 2.034 2.034 ↑ 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.003..0.003 rows=1 loops=678)

  • Index Cond: (fwd_channel_id = message.fwd_channel_id)
14. 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