explain.depesz.com

PostgreSQL's explain analyze made readable

Result: J3SV

Settings
# exclusive inclusive rows x rows loops node
1. 0.844 71.960 ↓ 13.0 600 1

Unique (cost=8,604.44..8,604.78 rows=46 width=44) (actual time=70.677..71.960 rows=600 loops=1)

2. 7.616 71.116 ↓ 187.7 8,632 1

Sort (cost=8,604.44..8,604.55 rows=46 width=44) (actual time=70.675..71.116 rows=8,632 loops=1)

  • Sort Key: (count(r.inventory_id) OVER (?)) DESC, ((((cu.first_name)::text || ' '::text) || (cu.last_name)::text))
  • Sort Method: quicksort Memory: 1,058kB
3. 4.248 63.500 ↓ 187.7 8,632 1

WindowAgg (cost=8,602.13..8,603.17 rows=46 width=44) (actual time=57.922..63.500 rows=8,632 loops=1)

4. 4.783 59.252 ↓ 187.7 8,632 1

Sort (cost=8,602.13..8,602.25 rows=46 width=21) (actual time=57.902..59.252 rows=8,632 loops=1)

  • Sort Key: cu.customer_id
  • Sort Method: quicksort Memory: 1,057kB
5. 1.501 54.469 ↓ 187.7 8,632 1

Nested Loop Left Join (cost=8,216.45..8,600.86 rows=46 width=21) (actual time=15.045..54.469 rows=8,632 loops=1)

6. 4.011 35.704 ↓ 187.7 8,632 1

Hash Right Join (cost=8,216.17..8,586.80 rows=46 width=6) (actual time=14.060..35.704 rows=8,632 loops=1)

  • Hash Cond: (r.inventory_id = inv.inventory_id)
7. 18.746 18.746 ↑ 1.0 16,044 1

Seq Scan on rental r (cost=0.00..310.44 rows=16,044 width=6) (actual time=1.101..18.746 rows=16,044 loops=1)

8. 0.565 12.947 ↓ 54.2 2,494 1

Hash (cost=8,215.60..8,215.60 rows=46 width=4) (actual time=12.947..12.947 rows=2,494 loops=1)

  • Buckets: 4,096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 120kB
9. 1.058 12.382 ↓ 54.2 2,494 1

Subquery Scan on inv (cost=76.50..8,215.60 rows=46 width=4) (actual time=5.838..12.382 rows=2,494 loops=1)

  • Filter: (inv.sf_string ~~ '%Behind the Scenes%'::text)
  • Rows Removed by Filter: 7,274
10. 3.889 11.324 ↑ 46.9 9,768 1

Hash Full Join (cost=76.50..2,489.35 rows=458,100 width=710) (actual time=5.833..11.324 rows=9,768 loops=1)

  • Hash Cond: (i.film_id = f.film_id)
11. 2.780 2.780 ↑ 1.0 4,581 1

Seq Scan on inventory i (cost=0.00..70.81 rows=4,581 width=6) (actual time=1.153..2.780 rows=4,581 loops=1)

12. 0.198 4.655 ↑ 1.0 1,000 1

Hash (cost=64.00..64.00 rows=1,000 width=63) (actual time=4.655..4.655 rows=1,000 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 104kB
13. 4.457 4.457 ↑ 1.0 1,000 1

Seq Scan on film f (cost=0.00..64.00 rows=1,000 width=63) (actual time=0.728..4.457 rows=1,000 loops=1)

14. 17.264 17.264 ↑ 1.0 1 8,632

Index Scan using customer_pkey on customer cu (cost=0.28..0.30 rows=1 width=17) (actual time=0.002..0.002 rows=1 loops=8,632)

  • Index Cond: (r.customer_id = customer_id)
Planning time : 43.858 ms
Execution time : 72.212 ms