explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5oiG : Optimization for: Optimization for: Evaluate and Select; plan #9dE; plan #PmlZ

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 1,302.722 3,257.597 ↓ 97.6 3,441,157 1

Merge Join (cost=65,727.60..371,428.67 rows=35,269 width=37) (actual time=201.312..3,257.597 rows=3,441,157 loops=1)

  • Merge Cond: ((a.swimmer = b.swimmer) AND (a.season_id = b.season_id))
  • Join Filter: ((a.seasonmonth <= b.seasonmonth) AND ((a.value <> b.value) OR (a.seasonmonth <> b.seasonmonth) OR (a.goal <> b.goal) OR (a.style_id <> b.style_id)))
  • Rows Removed by Join Filter: 2885798
2.          

CTE subtabla

3. 66.981 87.815 ↑ 1.1 156,872 1

Bitmap Heap Scan on "MLSource" (cost=3,620.62..47,494.95 rows=170,555 width=18) (actual time=26.383..87.815 rows=156,872 loops=1)

  • Recheck Cond: ((goal = 200) AND (style_id = 4))
  • Heap Blocks: exact=37565
4. 20.834 20.834 ↑ 1.1 156,872 1

Bitmap Index Scan on goal_style (cost=0.00..3,577.98 rows=170,555 width=0) (actual time=20.834..20.834 rows=156,872 loops=1)

  • Index Cond: ((goal = 200) AND (style_id = 4))
5. 1,561.004 1,561.004 ↑ 1.0 4,420,723 1

Index Scan using swimmer_season on "MLSource" a (cost=0.43..279,938.04 rows=4,420,728 width=29) (actual time=0.014..1,561.004 rows=4,420,723 loops=1)

6. 253.641 393.871 ↓ 37.1 6,326,953 1

Sort (cost=18,232.23..18,658.61 rows=170,555 width=18) (actual time=201.279..393.871 rows=6,326,953 loops=1)

  • Sort Key: b.swimmer, b.season_id
  • Sort Method: quicksort Memory: 18400kB
7. 140.230 140.230 ↑ 1.1 156,872 1

CTE Scan on subtabla b (cost=0.00..3,411.10 rows=170,555 width=18) (actual time=26.387..140.230 rows=156,872 loops=1)

Planning time : 0.752 ms