explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fMAYH

Settings
# exclusive inclusive rows x rows loops node
1. 0.346 29.940 ↓ 7.5 599 1

Nested Loop Left Join (cost=1,902.80..2,291.45 rows=80 width=54) (actual time=12.119..29.940 rows=599 loops=1)

2.          

CTE r

3. 6.585 18.816 ↑ 1.0 16,044 1

WindowAgg (cost=1,431.09..1,751.97 rows=16,044 width=44) (actual time=9.856..18.816 rows=16,044 loops=1)

4. 10.067 12.231 ↑ 1.0 16,044 1

Sort (cost=1,431.09..1,471.20 rows=16,044 width=36) (actual time=9.848..12.231 rows=16,044 loops=1)

  • Sort Key: rental.customer_id, rental.rental_date DESC
  • Sort Method: quicksort Memory: 1,638kB
5. 2.164 2.164 ↑ 1.0 16,044 1

Seq Scan on rental (cost=0.00..310.44 rows=16,044 width=36) (actual time=0.007..2.164 rows=16,044 loops=1)

6. 0.300 28.396 ↓ 7.5 599 1

Hash Left Join (cost=150.55..511.96 rows=80 width=41) (actual time=12.099..28.396 rows=599 loops=1)

  • Hash Cond: (r.inventory_id = i.inventory_id)
7. 0.272 26.164 ↓ 7.5 599 1

Hash Left Join (cost=22.48..383.68 rows=80 width=43) (actual time=10.153..26.164 rows=599 loops=1)

  • Hash Cond: (r.customer_id = c.customer_id)
8. 25.618 25.618 ↓ 7.5 599 1

CTE Scan on r (cost=0.00..360.99 rows=80 width=6) (actual time=9.860..25.618 rows=599 loops=1)

  • Filter: (row_number = 1)
  • Rows Removed by Filter: 15,445
9. 0.130 0.274 ↑ 1.0 599 1

Hash (cost=14.99..14.99 rows=599 width=43) (actual time=0.274..0.274 rows=599 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 54kB
10. 0.144 0.144 ↑ 1.0 599 1

Seq Scan on customer c (cost=0.00..14.99 rows=599 width=43) (actual time=0.016..0.144 rows=599 loops=1)

11. 0.941 1.932 ↑ 1.0 4,581 1

Hash (cost=70.81..70.81 rows=4,581 width=6) (actual time=1.932..1.932 rows=4,581 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 234kB
12. 0.991 0.991 ↑ 1.0 4,581 1

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

13. 1.198 1.198 ↑ 1.0 1 599

Index Scan using film_pkey on film f (cost=0.28..0.34 rows=1 width=19) (actual time=0.002..0.002 rows=1 loops=599)

  • Index Cond: (film_id = i.film_id)