explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BciQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.711 137.371 ↓ 13.0 600 1

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

2. 6.050 136.660 ↓ 187.7 8,632 1

Sort (cost=8,604.44..8,604.55 rows=46 width=44) (actual time=136.134..136.660 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.395 130.610 ↓ 187.7 8,632 1

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

4. 79.311 126.215 ↓ 187.7 8,632 1

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

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

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

6. 6.563 26.247 ↓ 187.7 8,632 1

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

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

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

8. 5.768 15.049 ↓ 54.2 2,494 1

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

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

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

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

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

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

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

12. 0.876 1.248 ↑ 1.0 1,000 1

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

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

Seq Scan on film f (cost=0.00..64.00 rows=1,000 width=63) (actual time=0.018..0.372 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 : 3.266 ms
Execution time : 139.326 ms