explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jke

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 1,483.053 ↑ 1.0 10 1

Limit (cost=32,189.59..32,189.62 rows=10 width=4) (actual time=1,483.048..1,483.053 rows=10 loops=1)

2. 0.209 1,483.049 ↑ 642.5 10 1

Sort (cost=32,189.59..32,205.65 rows=6,425 width=4) (actual time=1,483.047..1,483.049 rows=10 loops=1)

  • Sort Key: (((t.tb)::real / (t.ab)::real)) DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 0.422 1,482.840 ↑ 6.5 988 1

Subquery Scan on t (cost=31,874.06..32,050.75 rows=6,425 width=4) (actual time=1,481.938..1,482.840 rows=988 loops=1)

4. 241.704 1,482.418 ↑ 6.5 988 1

HashAggregate (cost=31,874.06..31,938.31 rows=6,425 width=164) (actual time=1,481.934..1,482.418 rows=988 loops=1)

  • Group Key: pitch.batter_mlb_id
  • Filter: (sum(mlbam_lk_event_type.ab) > 0)
  • Rows Removed by Filter: 6
5. 296.597 1,240.714 ↑ 1.1 734,980 1

Hash Left Join (cost=1.89..23,861.39 rows=801,267 width=8) (actual time=15.929..1,240.714 rows=734,980 loops=1)

  • Hash Cond: (pitch.event_type = mlbam_lk_event_type.event_type)
6. 222.065 944.066 ↑ 1.1 734,980 1

Append (cost=0.00..18,311.53 rows=801,267 width=15) (actual time=15.867..944.066 rows=734,980 loops=1)

7. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on aggregated_pitches pitch (cost=0.00..0.00 rows=1 width=68) (actual time=0.002..0.002 rows=0 loops=1)

  • Filter: ((pbp_game_type <> 'S'::text) AND (season = 2018) AND (raw_sport_code = 'mlb'::text))
8. 721.999 721.999 ↑ 1.1 734,980 1

Index Scan using aggregated_pitches_2018_raw_sport_code_idx on aggregated_pitches_2018 pitch_1 (cost=0.43..18,311.53 rows=801,266 width=15) (actual time=15.864..721.999 rows=734,980 loops=1)

  • Index Cond: (raw_sport_code = 'mlb'::text)
  • Filter: ((pbp_game_type <> 'S'::text) AND (season = 2018))
  • Rows Removed by Filter: 73986
9. 0.019 0.051 ↑ 1.0 51 1

Hash (cost=1.25..1.25 rows=51 width=19) (actual time=0.051..0.051 rows=51 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
10. 0.032 0.032 ↑ 1.0 51 1

Index Scan using mlbam_lk_event_type_pkey on mlbam_lk_event_type (cost=0.14..1.25 rows=51 width=19) (actual time=0.006..0.032 rows=51 loops=1)

Planning time : 1.572 ms
Execution time : 1,483.142 ms