explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LBtk

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.065 20.024 ↑ 1.0 9 1

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

2. 0.018 0.510 ↑ 1.0 9 1

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

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

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

4. 0.095 0.095 ↑ 1.0 1 1

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

  • Index Cond: ((title)::text = 'Casablanca'::text)
5. 0.010 0.010 ↑ 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.010..0.010 rows=1 loops=1)

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

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

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

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

  • Index Cond: (id = castings.actor_id)