explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cElT

Settings
# exclusive inclusive rows x rows loops node
1. 25.640 75,063.658 ↑ 1.0 11 1

Limit (cost=51,517.48..107,071.53 rows=11 width=71) (actual time=26,329.713..75,063.658 rows=11 loops=1)

2. 0.151 75,038.018 ↑ 6.2 21 1

GroupAggregate (cost=1,013.80..657,561.63 rows=130 width=71) (actual time=127.320..75,038.018 rows=21 loops=1)

  • Group Key: m.movie_id
3. 188.311 75,037.867 ↑ 4.3 30 1

Nested Loop Left Join (cost=1,013.80..657,559.35 rows=130 width=71) (actual time=127.000..75,037.867 rows=30 loops=1)

  • Filter: (((d.director_fname)::text ~~* 'joe'::text) OR ((d.director_lname)::text ~~* 'joe'::text) OR ((a.actor_fname)::text ~~* 'chris'::text) OR ((a.actor_lname)::text ~~* 'chris'::text))
  • Rows Removed by Filter: 203139
4. 115.837 11,257.659 ↑ 1.7 203,169 1

Merge Left Join (cost=1,013.38..486,764.99 rows=340,639 width=88) (actual time=126.980..11,257.659 rows=203,169 loops=1)

  • Merge Cond: (m.movie_id = mc.movie_id)
5. 0.000 9,935.488 ↑ 1.7 201,305 1

Gather Merge (cost=1,007.89..440,569.27 rows=340,639 width=84) (actual time=126.962..9,935.488 rows=201,305 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 51.027 92,621.328 ↑ 2.1 67,455 3

Nested Loop Left Join (cost=7.87..400,251.05 rows=141,933 width=84) (actual time=2.942..30,873.776 rows=67,455 loops=3)

7. 157.791 8,993.556 ↑ 2.1 67,455 3

Merge Left Join (cost=7.45..331,738.07 rows=141,933 width=75) (actual time=2.926..2,997.852 rows=67,455 loops=3)

  • Merge Cond: (m.movie_id = md.movie_id)
8. 195.818 6,598.263 ↑ 2.1 67,152 3

Nested Loop (cost=0.99..286,198.35 rows=141,933 width=71) (actual time=0.420..2,199.421 rows=67,152 loops=3)

9. 2.190 4,992.246 ↑ 2.1 67,152 3

Nested Loop (cost=0.55..104,213.01 rows=141,947 width=36) (actual time=0.280..1,664.082 rows=67,152 loops=3)

10. 4,053.339 4,053.339 ↑ 4.1 104,080 3

Parallel Index Scan using movie_genres_movie_id_index on movie_genres mg (cost=0.42..38,912.54 rows=425,840 width=8) (actual time=0.136..1,351.113 rows=104,080 loops=3)

11. 936.717 936.717 ↑ 1.0 1 312,239

Index Scan using genres_pkey on genres g (cost=0.13..0.15 rows=1 width=36) (actual time=0.003..0.003 rows=1 loops=312,239)

  • Index Cond: (genre_id = mg.genre_id)
  • Filter: ((genre_name)::text ~~* '%sci-fi%'::text)
  • Rows Removed by Filter: 0
12. 1,410.199 1,410.199 ↑ 1.0 1 201,457

Index Scan using movie_pkey on movie m (cost=0.43..1.28 rows=1 width=39) (actual time=0.007..0.007 rows=1 loops=201,457)

  • Index Cond: (movie_id = mg.movie_id)
  • Filter: (((movie_title)::text ~~* '%'::text) AND (movie_year >= 0) AND (movie_year <= 2020))
13. 2,237.502 2,237.502 ↑ 3.3 297,539 3

Index Scan using movie_director_movie_id_index on movie_director md (cost=0.42..42,621.62 rows=971,017 width=8) (actual time=0.074..745.834 rows=297,539 loops=3)

14. 83,576.745 83,576.745 ↓ 0.0 0 202,365

Index Scan using director_pkey on director d (cost=0.42..0.48 rows=1 width=17) (actual time=0.413..0.413 rows=0 loops=202,365)

  • Index Cond: (md.director_id = director_id)
15. 1,206.334 1,206.334 ↑ 3.3 297,679 1

Index Scan using movie_cast_movie_id_index on movie_cast mc (cost=0.42..42,590.23 rows=970,020 width=8) (actual time=0.015..1,206.334 rows=297,679 loops=1)

16. 63,591.897 63,591.897 ↓ 0.0 0 203,169

Index Scan using actor_pkey on actor a (cost=0.42..0.48 rows=1 width=17) (actual time=0.313..0.313 rows=0 loops=203,169)

  • Index Cond: (mc.actor_id = actor_id)