explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GoMj

Settings
# exclusive inclusive rows x rows loops node
1. 230.790 3,442.641 ↑ 1.2 9 1

Unique (cost=755,062.62..755,282.41 rows=11 width=4) (actual time=2,783.496..3,442.641 rows=9 loops=1)

2. 1,190.332 3,211.851 ↓ 135.2 5,942,235 1

Sort (cost=755,062.62..755,172.52 rows=43,958 width=4) (actual time=2,783.495..3,211.851 rows=5,942,235 loops=1)

  • Sort Key: messages.channel_id
  • Sort Method: external merge Disk: 81576kB
3. 980.583 2,021.519 ↓ 135.2 5,942,235 1

Gather (cost=1,000.86..751,672.62 rows=43,958 width=4) (actual time=1.235..2,021.519 rows=5,942,235 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 1,007.336 1,040.936 ↓ 114.9 2,971,118 2

Nested Loop (cost=0.85..746,276.82 rows=25,858 width=4) (actual time=0.397..1,040.936 rows=2,971,118 loops=2)

5. 7.588 7.588 ↑ 1.1 32 2

Parallel Index Scan using bots_pkey on bots (cost=0.29..22,656.13 rows=35 width=4) (actual time=0.351..7.588 rows=32 loops=2)

  • Filter: (user_id = 254)
  • Rows Removed by Filter: 22749
6. 26.012 26.012 ↓ 5.1 92,847 64

Index Scan using messages_bot_id_idx on messages (cost=0.56..20,492.08 rows=18,280 width=8) (actual time=0.013..26.012 rows=92,847 loops=64)

  • Index Cond: (bot_id = bots.id)