explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ayc7

Settings
# exclusive inclusive rows x rows loops node
1. 15.265 283.183 ↑ 1.0 200 1

GroupAggregate (cost=532.10..301,171.07 rows=200 width=49) (actual time=3.850..283.183 rows=200 loops=1)

  • Group Key: a.actor_id
  • Buffers: shared hit=105,759
2. 2.228 5.742 ↑ 1.0 5,462 1

Merge Left Join (cost=532.10..630.53 rows=5,462 width=28) (actual time=2.847..5.742 rows=5,462 loops=1)

  • Merge Cond: (a.actor_id = fa.actor_id)
  • Buffers: shared hit=40
3. 0.163 0.163 ↑ 1.0 200 1

Index Only Scan using actor_pkey_incl on actor a (cost=0.14..16.14 rows=200 width=17) (actual time=0.009..0.163 rows=200 loops=1)

  • Heap Fetches: 200
  • Buffers: shared hit=3
4. 1.262 3.351 ↑ 1.0 5,462 1

Sort (cost=531.96..545.61 rows=5,462 width=13) (actual time=2.834..3.351 rows=5,462 loops=1)

  • Sort Key: fa.actor_id
  • Sort Method: quicksort Memory: 461kB
  • Buffers: shared hit=37
5. 1.346 2.089 ↑ 1.0 5,462 1

Hash Left Join (cost=33.17..192.90 rows=5,462 width=13) (actual time=0.429..2.089 rows=5,462 loops=1)

  • Hash Cond: (fa.film_id = fc.film_id)
  • Buffers: shared hit=37
6. 0.323 0.323 ↑ 1.0 5,462 1

Seq Scan on film_actor fa (cost=0.00..84.62 rows=5,462 width=4) (actual time=0.007..0.323 rows=5,462 loops=1)

  • Buffers: shared hit=30
7. 0.142 0.420 ↑ 1.0 1,000 1

Hash (cost=20.67..20.67 rows=1,000 width=13) (actual time=0.418..0.420 rows=1,000 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 55kB
  • Buffers: shared hit=7
8. 0.196 0.278 ↑ 1.0 1,000 1

Hash Left Join (cost=1.36..20.67 rows=1,000 width=13) (actual time=0.021..0.278 rows=1,000 loops=1)

  • Hash Cond: (fc.category_id = c.category_id)
  • Buffers: shared hit=7
9. 0.069 0.069 ↑ 1.0 1,000 1

Seq Scan on film_category fc (cost=0.00..16.00 rows=1,000 width=4) (actual time=0.005..0.069 rows=1,000 loops=1)

  • Buffers: shared hit=6
10. 0.008 0.013 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=11) (actual time=0.012..0.013 rows=16 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
11. 0.005 0.005 ↑ 1.0 16 1

Seq Scan on category c (cost=0.00..1.16 rows=16 width=11) (actual time=0.004..0.005 rows=16 loops=1)

  • Buffers: shared hit=1
12.          

SubPlan (for GroupAggregate)

13. 43.696 262.176 ↑ 2.0 1 5,462

GroupAggregate (cost=17.07..54.77 rows=2 width=34) (actual time=0.048..0.048 rows=1 loops=5,462)

  • Group Key: fa_1.actor_id
  • Buffers: shared hit=105,719
14. 12.664 218.480 ↓ 1.5 3 5,462

Nested Loop (cost=17.07..54.24 rows=2 width=17) (actual time=0.034..0.040 rows=3 loops=5,462)

  • Buffers: shared hit=105,719
15. 38.234 191.170 ↓ 1.5 3 5,462

Hash Join (cost=16.80..47.84 rows=2 width=6) (actual time=0.031..0.035 rows=3 loops=5,462)

  • Hash Cond: (fa_1.film_id = fc_1.film_id)
  • Buffers: shared hit=61,781
16. 16.386 27.310 ↓ 1.0 28 5,462

Bitmap Heap Scan on film_actor fa_1 (cost=4.49..35.47 rows=27 width=4) (actual time=0.003..0.005 rows=28 loops=5,462)

  • Recheck Cond: (actor_id = a.actor_id)
  • Heap Blocks: exact=6,243
  • Buffers: shared hit=17,419
17. 10.924 10.924 ↓ 1.0 28 5,462

Bitmap Index Scan on film_actor_pkey (cost=0.00..4.48 rows=27 width=0) (actual time=0.002..0.002 rows=28 loops=5,462)

  • Index Cond: (actor_id = a.actor_id)
  • Buffers: shared hit=11,176
18. 54.620 125.626 ↓ 1.0 63 5,462

Hash (cost=11.53..11.53 rows=62 width=2) (actual time=0.023..0.023 rows=63 loops=5,462)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=44,362
19. 49.158 71.006 ↓ 1.0 63 5,462

Bitmap Heap Scan on film_category fc_1 (cost=4.76..11.53 rows=62 width=2) (actual time=0.005..0.013 rows=63 loops=5,462)

  • Recheck Cond: (category_id = c.category_id)
  • Heap Blocks: exact=32,772
  • Buffers: shared hit=44,362
20. 21.848 21.848 ↓ 1.0 63 5,462

Bitmap Index Scan on film_category_idx (cost=0.00..4.74 rows=62 width=0) (actual time=0.004..0.004 rows=63 loops=5,462)

  • Index Cond: (category_id = c.category_id)
  • Buffers: shared hit=11,590
21. 14.646 14.646 ↑ 1.0 1 14,646

Index Scan using film_pkey on film f (cost=0.28..3.20 rows=1 width=19) (actual time=0.001..0.001 rows=1 loops=14,646)

  • Index Cond: (film_id = fc_1.film_id)
  • Buffers: shared hit=43,938
Planning time : 0.840 ms