explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cn1j

Settings
# exclusive inclusive rows x rows loops node
1. 9.476 81,781.332 ↓ 100.8 63,218 1

Unique (cost=525,184.88..525,188.02 rows=627 width=8) (actual time=81,768.009..81,781.332 rows=63,218 loops=1)

2. 20.872 81,771.856 ↓ 100.8 63,218 1

Sort (cost=525,184.88..525,186.45 rows=627 width=8) (actual time=81,768.008..81,771.856 rows=63,218 loops=1)

  • Sort Key: s.id
  • Sort Method: quicksort Memory: 4500kB
3. 1,801.569 81,750.984 ↓ 100.8 63,218 1

Hash Join (cost=503,435.43..525,155.75 rows=627 width=8) (actual time=17,426.872..81,750.984 rows=63,218 loops=1)

  • Hash Cond: ((s.id_theater = t.theater_id) AND (rr.id_country = t.country_id))
4. 57,672.221 79,822.954 ↓ 111.8 14,008,569 1

Merge Join (cost=501,551.41..522,613.85 rows=125,309 width=18) (actual time=17,298.998..79,822.954 rows=14,008,569 loops=1)

  • Merge Cond: ((s.gid_entity)::ltree = (m.gid)::ltree)
  • Join Filter: ((s.theater_day)::text < rr.released_at)
  • Rows Removed by Join Filter: 62660526
5. 3,941.814 17,651.877 ↑ 1.0 2,521,193 1

Sort (cost=490,909.49..497,212.47 rows=2,521,193 width=59) (actual time=16,687.999..17,651.877 rows=2,521,193 loops=1)

  • Sort Key: s.gid_entity
  • Sort Method: external merge Disk: 182560kB
6. 13,710.063 13,710.063 ↑ 1.0 2,521,193 1

Seq Scan on relevant_showtime s (cost=0.00..167,312.93 rows=2,521,193 width=59) (actual time=3.859..13,710.063 rows=2,521,193 loops=1)

7. 3,954.782 4,498.856 ↓ 2,733.6 76,669,095 1

Sort (cost=10,641.42..10,711.53 rows=28,047 width=73) (actual time=607.449..4,498.856 rows=76,669,095 loops=1)

  • Sort Key: m.gid
  • Sort Method: quicksort Memory: 4682kB
8. 15.542 544.074 ↑ 1.0 28,047 1

Hash Join (cost=7,725.25..8,569.37 rows=28,047 width=73) (actual time=503.467..544.074 rows=28,047 loops=1)

  • Hash Cond: (rr.id_movie = m.id)
9. 29.320 29.320 ↑ 1.0 28,047 1

Seq Scan on relevant_release rr (cost=0.00..458.47 rows=28,047 width=40) (actual time=3.931..29.320 rows=28,047 loops=1)

10. 63.028 499.212 ↑ 1.0 188,100 1

Hash (cost=5,374.00..5,374.00 rows=188,100 width=45) (actual time=499.212..499.212 rows=188,100 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 16744kB
11. 436.184 436.184 ↑ 1.0 188,100 1

Seq Scan on relevant_movie m (cost=0.00..5,374.00 rows=188,100 width=45) (actual time=5.402..436.184 rows=188,100 loops=1)

12. 12.136 126.461 ↑ 1.0 36,401 1

Hash (cost=1,338.01..1,338.01 rows=36,401 width=14) (actual time=126.461..126.461 rows=36,401 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2219kB
13. 114.325 114.325 ↑ 1.0 36,401 1

Seq Scan on relevant_theater t (cost=0.00..1,338.01 rows=36,401 width=14) (actual time=3.330..114.325 rows=36,401 loops=1)