explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 23yF

Settings
# exclusive inclusive rows x rows loops node
1. 9.088 68,364.374 ↓ 100.8 63,218 1

Unique (cost=525,184.88..525,188.02 rows=627 width=8) (actual time=68,351.358..68,364.374 rows=63,218 loops=1)

2. 20.899 68,355.286 ↓ 100.8 63,218 1

Sort (cost=525,184.88..525,186.45 rows=627 width=8) (actual time=68,351.357..68,355.286 rows=63,218 loops=1)

  • Sort Key: s.id
  • Sort Method: quicksort Memory: 4500kB
3. 1,780.967 68,334.387 ↓ 100.8 63,218 1

Hash Join (cost=503,435.43..525,155.75 rows=627 width=8) (actual time=3,470.806..68,334.387 rows=63,218 loops=1)

  • Hash Cond: ((s.id_theater = t.theater_id) AND (rr.id_country = t.country_id))
4. 58,299.064 66,524.079 ↓ 111.8 14,008,569 1

Merge Join (cost=501,551.41..522,613.85 rows=125,309 width=18) (actual time=3,440.255..66,524.079 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,405.312 4,273.958 ↑ 1.0 2,521,193 1

Sort (cost=490,909.49..497,212.47 rows=2,521,193 width=59) (actual time=3,310.218..4,273.958 rows=2,521,193 loops=1)

  • Sort Key: s.gid_entity
  • Sort Method: external merge Disk: 182560kB
6. 868.646 868.646 ↑ 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=0.009..868.646 rows=2,521,193 loops=1)

7. 3,868.051 3,951.057 ↓ 2,733.6 76,669,095 1

Sort (cost=10,641.42..10,711.53 rows=28,047 width=73) (actual time=127.151..3,951.057 rows=76,669,095 loops=1)

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

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

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

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

10. 34.308 71.100 ↑ 1.0 188,100 1

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

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

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

12. 12.106 29.341 ↑ 1.0 36,401 1

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

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

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