explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cmdy : 1

Settings
# exclusive inclusive rows x rows loops node
1. 0.735 38.739 ↓ 13.0 600 1

Unique (cost=8,598.88..8,599.22 rows=46 width=44) (actual time=37.680..38.739 rows=600 loops=1)

2. 10.949 38.004 ↓ 187.7 8,632 1

Sort (cost=8,598.88..8,598.99 rows=46 width=44) (actual time=37.678..38.004 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. 3.828 27.055 ↓ 187.7 8,632 1

WindowAgg (cost=8,596.57..8,597.61 rows=46 width=44) (actual time=22.631..27.055 rows=8,632 loops=1)

4. 2.966 23.227 ↓ 187.7 8,632 1

Sort (cost=8,596.57..8,596.69 rows=46 width=21) (actual time=22.615..23.227 rows=8,632 loops=1)

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

Nested Loop Left Join (cost=8,211.35..8,595.30 rows=46 width=21) (actual time=5.783..20.261 rows=8,632 loops=1)

6. 2.746 9.579 ↓ 187.7 8,632 1

Hash Right Join (cost=8,211.07..8,581.70 rows=46 width=6) (actual time=5.770..9.579 rows=8,632 loops=1)

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

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

8. 0.337 5.742 ↓ 54.2 2,494 1

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

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

Subquery Scan on inv (cost=76.50..8,210.50 rows=46 width=4) (actual time=0.380..5.405 rows=2,494 loops=1)

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

ProjectSet (cost=76.50..2,484.25 rows=458,100 width=710) (actual time=0.378..4.489 rows=9,768 loops=1)

11. 0.979 1.637 ↓ 1.0 4,623 1

Hash Full Join (cost=76.50..159.39 rows=4,581 width=63) (actual time=0.375..1.637 rows=4,623 loops=1)

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

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

13. 0.160 0.361 ↑ 1.0 1,000 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 104kB
14. 0.201 0.201 ↑ 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.201 rows=1,000 loops=1)

15. 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.473 ms
Execution time : 39.152 ms