explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ho56 : Optimization for: plan #GWle

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.026 0.151 ↑ 1.0 5 1

Sort (cost=42.80..42.81 rows=5 width=138) (actual time=0.150..0.151 rows=5 loops=1)

  • Sort Key: (max(blocks.height)) DESC
  • Sort Method: quicksort Memory: 26kB
2. 0.006 0.125 ↑ 1.0 5 1

GroupAggregate (cost=42.65..42.74 rows=5 width=138) (actual time=0.120..0.125 rows=5 loops=1)

  • Group Key: blocks.id
3. 0.015 0.119 ↑ 1.0 5 1

Sort (cost=42.65..42.66 rows=5 width=138) (actual time=0.117..0.119 rows=5 loops=1)

  • Sort Key: blocks.id
  • Sort Method: quicksort Memory: 26kB
4. 0.028 0.104 ↑ 1.0 5 1

Nested Loop (cost=0.74..42.59 rows=5 width=138) (actual time=0.068..0.104 rows=5 loops=1)

5. 0.006 0.031 ↑ 1.0 5 1

HashAggregate (cost=0.33..0.38 rows=5 width=65) (actual time=0.031..0.031 rows=5 loops=1)

  • Group Key: blocks_1.id
6. 0.003 0.025 ↑ 1.0 5 1

Limit (cost=0.00..0.27 rows=5 width=65) (actual time=0.023..0.025 rows=5 loops=1)

7. 0.022 0.022 ↑ 8,045.2 5 1

Seq Scan on blocks blocks_1 (cost=0.00..2,151.26 rows=40,226 width=65) (actual time=0.022..0.022 rows=5 loops=1)

8. 0.045 0.045 ↑ 1.0 1 5

Index Scan using blocks_pkey on blocks (cost=0.41..8.43 rows=1 width=138) (actual time=0.009..0.009 rows=1 loops=5)

  • Index Cond: (id = blocks_1.id)