explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Y51n

Settings
# exclusive inclusive rows x rows loops node
1. 0.035 154.460 ↑ 5.2 98 1

Unique (cost=17,626.84..17,630.68 rows=512 width=24) (actual time=154.416..154.460 rows=98 loops=1)

2. 0.000 154.425 ↑ 2.8 184 1

Sort (cost=17,626.84..17,628.12 rows=512 width=24) (actual time=154.415..154.425 rows=184 loops=1)

  • Sort Key: m.id, m.title
  • Sort Method: quicksort Memory: 38kB
3. 8.159 155.905 ↑ 2.8 184 1

Gather (cost=4,556.36..17,603.80 rows=512 width=24) (actual time=74.057..155.905 rows=184 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 0.214 147.746 ↑ 3.5 61 3

Nested Loop (cost=3,556.36..16,552.60 rows=213 width=24) (actual time=70.097..147.746 rows=61 loops=3)

  • Join Filter: (gm.movie_id = m.id)
5. 0.089 147.529 ↑ 4.4 61 3

Hash Join (cost=3,556.07..16,465.31 rows=271 width=8) (actual time=70.077..147.529 rows=61 loops=3)

  • Hash Cond: (tm.movie_id = gm.movie_id)
6. 29.260 125.055 ↑ 11.9 194 3

Hash Join (cost=1,591.40..14,489.25 rows=2,313 width=4) (actual time=47.138..125.055 rows=194 loops=3)

  • Hash Cond: (tm.tag_id = t.id)
7. 48.938 48.938 ↑ 1.2 369,666 3

Parallel Seq Scan on movie_tags tm (cost=0.00..11,684.82 rows=462,082 width=8) (actual time=0.066..48.938 rows=369,666 loops=3)

8. 0.009 46.857 ↑ 187.0 2 3

Hash (cost=1,586.72..1,586.72 rows=374 width=4) (actual time=46.857..46.857 rows=2 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 46.848 46.848 ↑ 187.0 2 3

Seq Scan on tags t (cost=0.00..1,586.72 rows=374 width=4) (actual time=20.599..46.848 rows=2 loops=3)

  • Filter: (lower(name) = 'zombie'::text)
  • Rows Removed by Filter: 74713
10. 2.945 22.385 ↓ 3.0 15,956 3

Hash (cost=1,897.67..1,897.67 rows=5,360 width=4) (actual time=22.384..22.385 rows=15,956 loops=3)

  • Buckets: 16384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 689kB
11. 11.835 19.440 ↓ 3.0 15,956 3

Hash Join (cost=1.30..1,897.67 rows=5,360 width=4) (actual time=0.042..19.440 rows=15,956 loops=3)

  • Hash Cond: (gm.genre_id = g.id)
12. 7.588 7.588 ↑ 1.0 101,841 3

Seq Scan on movie_genres gm (cost=0.00..1,569.41 rows=101,841 width=8) (actual time=0.012..7.588 rows=101,841 loops=3)

13. 0.001 0.017 ↑ 1.0 1 3

Hash (cost=1.28..1.28 rows=1 width=4) (actual time=0.017..0.017 rows=1 loops=3)

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

Seq Scan on genres g (cost=0.00..1.28 rows=1 width=4) (actual time=0.010..0.016 rows=1 loops=3)

  • Filter: (lower(name) = 'comedy'::text)
  • Rows Removed by Filter: 18
15. 0.003 0.003 ↑ 1.0 1 184

Index Scan using movies_pkey on movies m (cost=0.29..0.31 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=184)

  • Index Cond: (id = tm.movie_id)