explain.depesz.com

PostgreSQL's explain analyze made readable

Result: s1OAQ

Settings
# exclusive inclusive rows x rows loops node
1. 3.411 496.531 ↓ 120.0 600 1

Unique (cost=1,089.63..1,089.66 rows=5 width=44) (actual time=492.397..496.531 rows=600 loops=1)

2. 37.603 493.120 ↓ 1,726.4 8,632 1

Sort (cost=1,089.63..1,089.64 rows=5 width=44) (actual time=492.393..493.120 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. 28.201 455.517 ↓ 1,726.4 8,632 1

WindowAgg (cost=1,089.46..1,089.57 rows=5 width=44) (actual time=425.225..455.517 rows=8,632 loops=1)

4. 74.713 427.316 ↓ 1,726.4 8,632 1

Sort (cost=1,089.46..1,089.47 rows=5 width=21) (actual time=425.154..427.316 rows=8,632 loops=1)

  • Sort Key: cu.customer_id
  • Sort Method: quicksort Memory: 1,057kB
5. 63.902 352.603 ↓ 1,726.4 8,632 1

Nested Loop Left Join (cost=81.09..1,089.40 rows=5 width=21) (actual time=3.591..352.603 rows=8,632 loops=1)

6. 86.006 202.381 ↓ 1,726.4 8,632 1

Nested Loop Left Join (cost=80.82..1,087.92 rows=5 width=6) (actual time=3.526..202.381 rows=8,632 loops=1)

7. 8.393 49.037 ↓ 498.8 2,494 1

Subquery Scan on inv (cost=76.50..995.42 rows=5 width=4) (actual time=3.415..49.037 rows=2,494 loops=1)

  • Filter: (inv.sf_string ~~ '%Behind the Scenes%'::text)
  • Rows Removed by Filter: 7,274
8. 24.377 40.644 ↑ 4.7 9,768 1

ProjectSet (cost=76.50..422.80 rows=45,810 width=710) (actual time=3.398..40.644 rows=9,768 loops=1)

9. 11.007 16.267 ↓ 1.0 4,623 1

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

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

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

11. 1.904 3.227 ↑ 1.0 1,000 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 104kB
12. 1.323 1.323 ↑ 1.0 1,000 1

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

13. 37.410 67.338 ↑ 1.3 3 2,494

Bitmap Heap Scan on rental r (cost=4.32..18.46 rows=4 width=6) (actual time=0.018..0.027 rows=3 loops=2,494)

  • Recheck Cond: (inventory_id = inv.inventory_id)
  • Heap Blocks: exact=8,602
14. 29.928 29.928 ↑ 1.3 3 2,494

Bitmap Index Scan on idx_fk_inventory_id (cost=0.00..4.32 rows=4 width=0) (actual time=0.012..0.012 rows=3 loops=2,494)

  • Index Cond: (inventory_id = inv.inventory_id)
15. 86.320 86.320 ↑ 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.010..0.010 rows=1 loops=8,632)

  • Index Cond: (customer_id = r.customer_id)
Planning time : 1.941 ms
Execution time : 497.520 ms