explain.depesz.com

PostgreSQL's explain analyze made readable

Result: S1KT

Settings
# exclusive inclusive rows x rows loops node
1. 334.718 46,167.787 ↓ 183.9 2,310,617 1

Unique (cost=581,023.58..581,086.41 rows=12,565 width=8) (actual time=45,576.595..46,167.787 rows=2,310,617 loops=1)

2. 1,165.100 45,833.069 ↓ 183.9 2,310,617 1

Sort (cost=581,023.58..581,054.99 rows=12,565 width=8) (actual time=45,576.594..45,833.069 rows=2,310,617 loops=1)

  • Sort Key: s.id
  • Sort Method: external merge Disk: 40704kB
3. 11,040.141 44,667.969 ↓ 183.9 2,310,617 1

Hash Join (cost=558,092.12..580,168.09 rows=12,565 width=8) (actual time=3,660.653..44,667.969 rows=2,310,617 loops=1)

  • Hash Cond: ((s.id_theater = t.theater_id) AND (rr.id_country = t.country_id))
4. 24,620.238 33,610.868 ↓ 212.0 85,901,246 1

Merge Join (cost=556,206.54..576,155.56 rows=405,134 width=18) (actual time=3,643.630..33,610.868 rows=85,901,246 loops=1)

  • Merge Cond: ((s.gid_entity)::ltree = (m.gid)::ltree)
5. 3,664.915 4,529.946 ↑ 1.0 2,774,813 1

Sort (cost=545,543.07..552,480.11 rows=2,774,814 width=51) (actual time=3,475.102..4,529.946 rows=2,774,813 loops=1)

  • Sort Key: s.gid_entity
  • Sort Method: external merge Disk: 165632kB
6. 865.031 865.031 ↑ 1.0 2,774,814 1

Seq Scan on relevant_showtime s (cost=0.00..193,032.14 rows=2,774,814 width=51) (actual time=0.007..865.031 rows=2,774,814 loops=1)

7. 4,335.109 4,460.684 ↓ 3,127.5 85,901,246 1

Sort (cost=10,662.92..10,731.58 rows=27,466 width=41) (actual time=168.496..4,460.684 rows=85,901,246 loops=1)

  • Sort Key: m.gid
  • Sort Method: quicksort Memory: 2915kB
8. 8.800 125.575 ↓ 1.0 27,481 1

Hash Join (cost=7,725.66..8,637.94 rows=27,466 width=41) (actual time=70.961..125.575 rows=27,481 loops=1)

  • Hash Cond: (rr.id_movie = m.id)
9. 46.077 46.077 ↓ 1.0 27,481 1

Seq Scan on relevant_release rr (cost=0.00..534.62 rows=27,466 width=8) (actual time=0.023..46.077 rows=27,481 loops=1)

  • Filter: (released_at ~ '^(?:[0-9]{4}-[0-9]{2}-[0-9]{2})$'::text)
  • Rows Removed by Filter: 889
10. 35.364 70.698 ↑ 1.0 188,118 1

Hash (cost=5,374.18..5,374.18 rows=188,118 width=45) (actual time=70.697..70.698 rows=188,118 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 16745kB
11. 35.334 35.334 ↑ 1.0 188,118 1

Seq Scan on relevant_movie m (cost=0.00..5,374.18 rows=188,118 width=45) (actual time=0.008..35.334 rows=188,118 loops=1)

12. 6.861 16.960 ↑ 1.0 36,423 1

Hash (cost=1,339.23..1,339.23 rows=36,423 width=14) (actual time=16.960..16.960 rows=36,423 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2220kB
13. 10.099 10.099 ↑ 1.0 36,423 1

Seq Scan on relevant_theater t (cost=0.00..1,339.23 rows=36,423 width=14) (actual time=0.009..10.099 rows=36,423 loops=1)