explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GYnW

Settings
# exclusive inclusive rows x rows loops node
1. 0.874 48.323 ↓ 13.0 600 1

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

2. 10.008 47.449 ↓ 187.7 8,632 1

Sort (cost=8,604.44..8,604.55 rows=46 width=44) (actual time=46.871..47.449 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. 5.091 37.441 ↓ 187.7 8,632 1

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

4. 3.280 32.350 ↓ 187.7 8,632 1

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

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

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

6. 3.180 14.376 ↓ 187.7 8,632 1

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

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

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

8. 0.409 9.716 ↓ 54.2 2,494 1

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

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

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

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

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

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

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

12. 0.162 0.478 ↑ 1.0 1,000 1

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

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

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

14. 8.632 8.632 ↑ 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.001..0.001 rows=1 loops=8,632)

  • Index Cond: (r.customer_id = customer_id)
Planning time : 0.689 ms
Execution time : 48.496 ms