explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rGod

Settings
# exclusive inclusive rows x rows loops node
1. 7.688 25.892 ↑ 950.5 2 1

GroupAggregate (cost=3,920.89..4,068.21 rows=1,901 width=262) (actual time=22.872..25.892 rows=2 loops=1)

  • Group Key: pitch.season, pitch.batter_mlb_id
2. 3.066 18.204 ↓ 2.5 4,819 1

Sort (cost=3,920.89..3,925.64 rows=1,901 width=56) (actual time=17.199..18.204 rows=4,819 loops=1)

  • Sort Key: pitch.batter_mlb_id
  • Sort Method: quicksort Memory: 645kB
3. 2.472 15.138 ↓ 2.5 4,819 1

Hash Left Join (cost=4.74..3,817.35 rows=1,901 width=56) (actual time=0.960..15.138 rows=4,819 loops=1)

  • Hash Cond: (pitch.pitch_result = mlbam_lk_pitch_code.pitch_code)
4. 1.971 12.651 ↓ 2.5 4,819 1

Hash Left Join (cost=3.15..3,797.54 rows=1,901 width=50) (actual time=0.934..12.651 rows=4,819 loops=1)

  • Hash Cond: (pitch.event_type = mlbam_lk_event_type.event_type)
5. 1.416 10.635 ↓ 2.5 4,819 1

Append (cost=0.00..3,781.23 rows=1,901 width=33) (actual time=0.876..10.635 rows=4,819 loops=1)

6. 0.001 0.001 ↓ 0.0 0 1

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

  • Filter: ((batter_mlb_id = ANY ('{641355,669257}'::integer[])) AND (season = 2018))
7. 8.624 9.218 ↓ 2.5 4,819 1

Bitmap Heap Scan on aggregated_pitches_2018 pitch_1 (cost=55.59..3,781.23 rows=1,900 width=33) (actual time=0.873..9.218 rows=4,819 loops=1)

  • Recheck Cond: (batter_mlb_id = ANY ('{641355,669257}'::integer[]))
  • Filter: (season = 2018)
  • Heap Blocks: exact=2148
8. 0.594 0.594 ↓ 2.5 4,819 1

Bitmap Index Scan on aggregated_pitches_2018_batter_mlb_id_idx (cost=0.00..55.12 rows=1,900 width=0) (actual time=0.594..0.594 rows=4,819 loops=1)

  • Index Cond: (batter_mlb_id = ANY ('{641355,669257}'::integer[]))
9. 0.026 0.045 ↑ 1.0 51 1

Hash (cost=2.51..2.51 rows=51 width=41) (actual time=0.045..0.045 rows=51 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
10. 0.019 0.019 ↑ 1.0 51 1

Seq Scan on mlbam_lk_event_type (cost=0.00..2.51 rows=51 width=41) (actual time=0.004..0.019 rows=51 loops=1)

11. 0.006 0.015 ↑ 1.2 12 1

Hash (cost=1.42..1.42 rows=14 width=10) (actual time=0.015..0.015 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.009 0.009 ↑ 1.2 12 1

Seq Scan on mlbam_lk_pitch_code (cost=0.00..1.42 rows=14 width=10) (actual time=0.003..0.009 rows=12 loops=1)

  • Filter: ((automatic = 0) AND (pitchout = 0) AND (bunt = 0))
  • Rows Removed by Filter: 12