explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,281.680 3,466.693 ↓ 97.6 3,441,157 1

Merge Join (cost=105,233.71..430,534.78 rows=35,269 width=37) (actual time=322.436..3,466.693 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. 0.000 212.614 ↑ 1.1 156,872 1

Gather (cost=1,000.00..87,001.05 rows=170,555 width=18) (actual time=1.025..212.614 rows=156,872 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 219.388 219.388 ↑ 1.4 52,291 3

Parallel Seq Scan on "MLSource" (cost=0.00..68,945.55 rows=71,065 width=18) (actual time=0.024..219.388 rows=52,291 loops=3)

  • Filter: ((goal = 200) AND (style_id = 4))
  • Rows Removed by Filter: 1421285
5. 1,672.361 1,672.361 ↑ 1.0 4,420,723 1

Index Scan using swimmer_season_month_goal_style_id on "MLSource" a (cost=0.43..299,538.04 rows=4,420,728 width=29) (actual time=0.022..1,672.361 rows=4,420,723 loops=1)

6. 254.123 512.652 ↓ 37.1 6,326,953 1

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

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

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