explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SCUB

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 6,890.567 ↑ 1.0 11 1

Limit (cost=865,182.86..865,183.17 rows=11 width=71) (actual time=6,890.559..6,890.567 rows=11 loops=1)

2. 0.020 6,890.563 ↑ 48,667.4 21 1

GroupAggregate (cost=865,182.59..893,288.03 rows=1,022,016 width=71) (actual time=6,890.551..6,890.563 rows=21 loops=1)

  • Group Key: m.movie_id, m.movie_title, m.movie_year, m.movie_country
3. 606.937 6,890.543 ↑ 44,435.5 23 1

Sort (cost=865,182.59..867,737.63 rows=1,022,016 width=71) (actual time=6,890.541..6,890.543 rows=23 loops=1)

  • Sort Key: m.movie_id, m.movie_title, m.movie_year, m.movie_country
  • Sort Method: external merge Disk: 59320kB
4. 238.321 6,283.606 ↑ 1.0 1,022,016 1

Hash Join (cost=7.55..679,331.13 rows=1,022,016 width=71) (actual time=0.133..6,283.606 rows=1,022,016 loops=1)

  • Hash Cond: (mg.genre_id = g.genre_id)
5. 868.143 6,045.232 ↑ 1.0 1,022,016 1

Merge Join (cost=6.48..672,857.29 rows=1,022,016 width=43) (actual time=0.070..6,045.232 rows=1,022,016 loops=1)

  • Merge Cond: (m.movie_id = mg.movie_id)
6. 4,349.856 4,349.856 ↑ 1.0 9,950,014 1

Index Scan using movie_pkey on movie m (cost=0.43..490,894.13 rows=9,950,015 width=39) (actual time=0.060..4,349.856 rows=9,950,014 loops=1)

  • Filter: ((movie_year >= 0) AND (movie_year <= 2020))
7. 827.233 827.233 ↑ 1.0 1,022,016 1

Index Scan using movie_genres_movie_id_index on movie_genres mg (cost=0.42..44,874.30 rows=1,022,016 width=8) (actual time=0.005..827.233 rows=1,022,016 loops=1)

8. 0.013 0.053 ↑ 1.0 3 1

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

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

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

  • Filter: ((genre_name)::text ~~* '%'::text)
Planning time : 0.552 ms
Execution time : 6,902.229 ms