explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PiPf

Settings
# exclusive inclusive rows x rows loops node
1. 19.682 921.521 ↓ 1.2 11 1

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

2. 0.017 901.839 ↓ 1.1 21 1

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

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

Sort (cost=15,539.91..15,539.96 rows=19 width=71) (actual time=901.822..901.822 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.043 901.804 ↓ 2.7 51 1

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

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

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

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

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

7. 0.323 899.941 ↓ 2.9 538 1

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

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

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

  • Group Key: m2.movie_id
9. 123.247 916.554 ↓ 2.9 538 1

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

  • Workers Planned: 2
  • Workers Launched: 2
10. 2.584 793.307 ↓ 2.3 179 3

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

11. 2.886 790.710 ↓ 2.3 179 3

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

12. 787.810 787.810 ↓ 2.2 175 3

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

  • Filter: (((director_fname)::text ~~* 'joe'::text) OR ((director_lname)::text ~~* 'joe'::text))
  • Rows Removed by Filter: 333160
13. 0.014 0.014 ↑ 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.013..0.014 rows=1 loops=525)

  • Index Cond: (director_id = d.director_id)
14. 0.013 0.013 ↑ 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.013..0.013 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.003 0.036 ↑ 1.0 3 1

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

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

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

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