explain.depesz.com

PostgreSQL's explain analyze made readable

Result: h6w2

Settings
# exclusive inclusive rows x rows loops node
1. 11.539 922.530 ↓ 1.2 11 1

Limit (cost=15,540.19..15,540.44 rows=9 width=71) (actual time=910.988..922.530 rows=11 loops=1)

2. 0.017 910.991 ↓ 1.1 21 1

GroupAggregate (cost=15,539.91..15,540.44 rows=19 width=71) (actual time=910.980..910.991 rows=21 loops=1)

  • Group Key: m.movie_id, m.movie_title, m.movie_year, m.movie_country
3. 0.016 910.974 ↓ 1.3 24 1

Sort (cost=15,539.91..15,539.96 rows=19 width=71) (actual time=910.973..910.974 rows=24 loops=1)

  • Sort Key: m.movie_id, m.movie_title, m.movie_year, m.movie_country
  • Sort Method: quicksort Memory: 30kB
4. 0.030 910.958 ↓ 2.7 51 1

Sort (cost=15,539.27..15,539.32 rows=19 width=71) (actual time=910.954..910.958 rows=51 loops=1)

  • Sort Key: m.movie_id
  • Sort Method: quicksort Memory: 30kB
5. 0.122 910.928 ↓ 2.7 51 1

Hash Join (cost=15,350.93..15,538.87 rows=19 width=71) (actual time=906.694..910.928 rows=51 loops=1)

  • Hash Cond: (mg.genre_id = g.genre_id)
6. 0.140 910.741 ↓ 2.7 51 1

Nested Loop (cost=15,349.85..15,537.68 rows=19 width=43) (actual time=906.529..910.741 rows=51 loops=1)

7. 0.311 908.987 ↓ 2.9 538 1

Nested Loop (cost=15,349.43..15,453.42 rows=185 width=47) (actual time=906.416..908.987 rows=538 loops=1)

  • Join Filter: (m.movie_id = md.movie_id)
8. 0.000 906.524 ↓ 2.9 538 1

HashAggregate (cost=15,348.99..15,350.84 rows=185 width=8) (actual time=906.394..906.524 rows=538 loops=1)

  • Group Key: m2.movie_id
9. 113.889 917.534 ↓ 2.9 538 1

Gather (cost=1,000.86..15,348.53 rows=185 width=8) (actual time=9.124..917.534 rows=538 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 2.852 803.645 ↓ 2.3 179 3

Nested Loop (cost=0.86..14,330.03 rows=77 width=8) (actual time=3.588..803.645 rows=179 loops=3)

11. 7.366 800.778 ↓ 2.3 179 3

Nested Loop (cost=0.42..14,228.57 rows=77 width=4) (actual time=3.517..800.778 rows=179 loops=3)

12. 793.372 793.372 ↓ 2.2 175 3

Parallel Seq Scan on director d (cost=0.00..13,267.02 rows=80 width=4) (actual time=3.475..793.372 rows=175 loops=3)

  • Filter: (((director_fname)::text ~~* 'joe'::text) OR ((director_lname)::text ~~* 'joe'::text))
  • Rows Removed by Filter: 333160
13. 0.040 0.040 ↑ 2.0 1 525

Index Scan using movie_director_director_id_index on movie_director md (cost=0.42..12.00 rows=2 width=8) (actual time=0.039..0.040 rows=1 loops=525)

  • Index Cond: (director_id = d.director_id)
14. 0.015 0.015 ↑ 1.0 1 538

Index Only Scan using movie_pkey on movie m2 (cost=0.43..1.32 rows=1 width=4) (actual time=0.015..0.015 rows=1 loops=538)

  • Index Cond: (movie_id = md.movie_id)
  • Heap Fetches: 538
15. 2.152 2.152 ↑ 1.0 1 538

Index Scan using movie_pkey on movie m (cost=0.43..0.54 rows=1 width=39) (actual time=0.004..0.004 rows=1 loops=538)

  • Index Cond: (movie_id = m2.movie_id)
  • Filter: ((movie_year >= 0) AND (movie_year <= 2020))
16. 1.614 1.614 ↓ 0.0 0 538

Index Scan using movie_genres_movie_id_index on movie_genres mg (cost=0.42..0.45 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=538)

  • Index Cond: (movie_id = m.movie_id)
17. 0.023 0.065 ↑ 1.0 3 1

Hash (cost=1.04..1.04 rows=3 width=36) (actual time=0.065..0.065 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.042 0.042 ↑ 1.0 3 1

Seq Scan on genres g (cost=0.00..1.04 rows=3 width=36) (actual time=0.035..0.042 rows=3 loops=1)

  • Filter: ((genre_name)::text ~~* '%'::text)