explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zG71

Settings
# exclusive inclusive rows x rows loops node
1. 0.756 35.090 ↓ 13.0 600 1

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

  • Buffers: shared hit=26,084
2. 3.961 34.334 ↓ 187.7 8,632 1

Sort (cost=8,604.44..8,604.55 rows=46 width=44) (actual time=33.84..34.334 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
  • Buffers: shared hit=26,084
3. 3.457 30.373 ↓ 187.7 8,632 1

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

  • Buffers: shared hit=26,084
4. 3.048 26.916 ↓ 187.7 8,632 1

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

  • Sort Key: cu.customer_id
  • Sort Method: quicksort Memory: 1,057kB
  • Buffers: shared hit=26,084
5. 2.940 23.868 ↓ 187.7 8,632 1

Nested Loop (cost=8,216.45..8,600.86 rows=46 width=21) (actual time=6.248..23.868 rows=8,632 loops=1)

  • Buffers: shared hit=26,084
6. 4.854 12.296 ↓ 187.7 8,632 1

Hash Join (cost=8,216.17..8,586.8 rows=46 width=6) (actual time=6.24..12.296 rows=8,632 loops=1)

  • Buffers: shared hit=229
7. 1.213 1.213 ↑ 1.0 16,044 1

Seq Scan on rental r (cost=0..310.44 rows=16,044 width=6) (actual time=0.007..1.213 rows=16,044 loops=1)

  • Buffers: shared hit=150
8. 0.256 6.229 ↓ 54.2 2,494 1

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

  • Buffers: shared hit=79
9. 0.975 5.973 ↓ 54.2 2,494 1

Subquery Scan on inv (cost=76.5..8,215.6 rows=46 width=4) (actual time=0.325..5.973 rows=2,494 loops=1)

  • Filter: (inv.sf_string ~~ '%Behind the Scenes%'::text)
  • Buffers: shared hit=79
10. 4.423 4.998 ↑ 46.9 9,768 1

Hash Join (cost=76.5..2,489.35 rows=458,100 width=710) (actual time=0.323..4.998 rows=9,768 loops=1)

  • Buffers: shared hit=79
11. 0.266 0.266 ↑ 1.0 4,581 1

Seq Scan on inventory i (cost=0..70.81 rows=4,581 width=6) (actual time=0.005..0.266 rows=4,581 loops=1)

  • Buffers: shared hit=25
12. 0.111 0.309 ↑ 1.0 1,000 1

Hash (cost=64..64 rows=1,000 width=63) (actual time=0.309..0.309 rows=1,000 loops=1)

  • Buffers: shared hit=54
13. 0.198 0.198 ↑ 1.0 1,000 1

Seq Scan on film f (cost=0..64 rows=1,000 width=63) (actual time=0.005..0.198 rows=1,000 loops=1)

  • Buffers: shared hit=54
14. 8.632 8.632 ↑ 1.0 1 8,632

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

  • Index Cond: (r.customer_id = cu.customer_id)
  • Buffers: shared hit=25,855
Planning time : 0.303 ms
Execution time : 35.173 ms