explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BEFO : Optimization for: Optimization for: Optimization for: plan #LBtk; plan #ZoKZ; plan #Itx8

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.022 0.356 ↑ 1.0 9 1

Nested Loop (cost=1.12..20.26 rows=9 width=14) (actual time=0.241..0.356 rows=9 loops=1)

2. 0.010 0.235 ↑ 1.0 9 1

Nested Loop (cost=0.84..17.44 rows=9 width=4) (actual time=0.207..0.235 rows=9 loops=1)

  • Join Filter: (a.id = castings.movie_id)
3. 0.008 0.103 ↑ 1.0 1 1

Nested Loop (cost=0.56..16.60 rows=1 width=8) (actual time=0.102..0.103 rows=1 loops=1)

4. 0.068 0.068 ↑ 1.0 1 1

Index Scan using movie_title on movies a (cost=0.28..8.29 rows=1 width=4) (actual time=0.067..0.068 rows=1 loops=1)

  • Index Cond: ((title)::text = 'Casablanca'::text)
5. 0.027 0.027 ↑ 1.0 1 1

Index Only Scan using movie_pkey on movies b (cost=0.28..8.29 rows=1 width=4) (actual time=0.027..0.027 rows=1 loops=1)

  • Index Cond: (id = a.id)
  • Heap Fetches: 1
6. 0.122 0.122 ↑ 1.0 9 1

Index Only Scan using casting_pkey on castings (cost=0.29..0.72 rows=9 width=8) (actual time=0.100..0.122 rows=9 loops=1)

  • Index Cond: (movie_id = b.id)
  • Heap Fetches: 9
7. 0.099 0.099 ↑ 1.0 1 9

Index Scan using actor_pkey on actors (cost=0.28..0.31 rows=1 width=18) (actual time=0.011..0.011 rows=1 loops=9)

  • Index Cond: (id = castings.actor_id)