explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sYEd

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 7,610.676 ↑ 1.0 11 1

GroupAggregate (cost=428.35..428.66 rows=11 width=71) (actual time=7,610.671..7,610.676 rows=11 loops=1)

  • Group Key: m.movie_id, m.movie_title, m.movie_year, m.movie_country
2. 0.050 7,610.664 ↑ 1.1 11 1

Sort (cost=428.35..428.38 rows=12 width=71) (actual time=7,610.663..7,610.664 rows=11 loops=1)

  • Sort Key: m.movie_id, m.movie_title, m.movie_year, m.movie_country
  • Sort Method: quicksort Memory: 25kB
3. 0.027 7,610.614 ↑ 1.1 11 1

Hash Left Join (cost=212.28..428.13 rows=12 width=71) (actual time=818.334..7,610.614 rows=11 loops=1)

  • Hash Cond: (mg.genre_id = g.genre_id)
4. 0.061 7,610.569 ↑ 1.1 11 1

Nested Loop Left Join (cost=211.21..426.99 rows=12 width=43) (actual time=818.302..7,610.569 rows=11 loops=1)

5. 0.070 7,610.442 ↑ 1.0 11 1

Limit (cost=210.78..333.90 rows=11 width=39) (actual time=818.290..7,610.442 rows=11 loops=1)

6. 4,264.769 7,610.372 ↑ 310,938.0 16 1

Nested Loop Semi Join (cost=154.82..55,682,438.98 rows=4,975,008 width=39) (actual time=3.756..7,610.372 rows=16 loops=1)

  • Join Filter: (m.movie_id = m_1.movie_id)
  • Rows Removed by Join Filter: 65956600
7. 28.869 28.869 ↑ 162.0 61,421 1

Index Scan using movie_pkey on movie m (cost=0.43..441,144.05 rows=9,950,015 width=39) (actual time=0.007..28.869 rows=61,421 loops=1)

8. 2,499.165 3,316.734 ↓ 2.9 1,074 61,421

Materialize (cost=154.39..18,712.60 rows=370 width=4) (actual time=0.000..0.054 rows=1,074 loops=61,421)

9. 0.052 817.569 ↓ 2.9 1,074 1

Append (cost=154.39..18,710.75 rows=370 width=4) (actual time=3.742..817.569 rows=1,074 loops=1)

10. 0.000 8.853 ↓ 2.9 536 1

Nested Loop (cost=154.39..3,356.67 rows=185 width=4) (actual time=3.741..8.853 rows=536 loops=1)

11. 0.343 6.790 ↓ 2.9 536 1

Nested Loop (cost=153.95..3,112.72 rows=185 width=4) (actual time=3.734..6.790 rows=536 loops=1)

12. 1.126 4.782 ↓ 2.9 555 1

Bitmap Heap Scan on actor a (cost=153.53..817.07 rows=191 width=4) (actual time=3.720..4.782 rows=555 loops=1)

  • Recheck Cond: (((actor_fname)::text ~~* 'chris'::text) OR ((actor_lname)::text ~~* 'chris'::text))
  • Heap Blocks: exact=531
13. 0.001 3.656 ↓ 0.0 0 1

BitmapOr (cost=153.53..153.53 rows=191 width=0) (actual time=3.656..3.656 rows=0 loops=1)

14. 2.072 2.072 ↓ 6.0 555 1

Bitmap Index Scan on fname_idx (cost=0.00..76.70 rows=93 width=0) (actual time=2.072..2.072 rows=555 loops=1)

  • Index Cond: ((actor_fname)::text ~~* 'chris'::text)
15. 1.583 1.583 ↓ 0.0 0 1

Bitmap Index Scan on lname_idx (cost=0.00..76.73 rows=98 width=0) (actual time=1.583..1.583 rows=0 loops=1)

  • Index Cond: ((actor_lname)::text ~~* 'chris'::text)
16. 1.665 1.665 ↑ 2.0 1 555

Index Scan using movie_cast_actor_id_index on movie_cast mc (cost=0.42..12.00 rows=2 width=8) (actual time=0.003..0.003 rows=1 loops=555)

  • Index Cond: (actor_id = a.actor_id)
17. 2.144 2.144 ↑ 1.0 1 536

Index Only Scan using movie_pkey on movie m_1 (cost=0.43..1.32 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=536)

  • Index Cond: (movie_id = mc.movie_id)
  • Heap Fetches: 536
18. 56.688 808.664 ↓ 2.9 538 1

Gather (cost=1,000.86..15,348.53 rows=185 width=4) (actual time=1.220..808.664 rows=538 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
19. 2.585 751.976 ↓ 2.3 179 3

Nested Loop (cost=0.86..14,330.03 rows=77 width=4) (actual time=1.947..751.976 rows=179 loops=3)

20. 2.892 749.378 ↓ 2.3 179 3

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

21. 746.472 746.472 ↓ 2.2 175 3

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

  • Filter: (((director_fname)::text ~~* 'joe'::text) OR ((director_lname)::text ~~* 'joe'::text))
  • Rows Removed by Filter: 333160
22. 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)
23. 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
24. 0.066 0.066 ↑ 1.0 1 11

Index Scan using movie_genres_movie_id_index on movie_genres mg (cost=0.42..8.44 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=11)

  • Index Cond: (m.movie_id = movie_id)
25. 0.003 0.018 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=36) (actual time=0.018..0.018 rows=3 loops=1)

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

Seq Scan on genres g (cost=0.00..1.03 rows=3 width=36) (actual time=0.014..0.015 rows=3 loops=1)