explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BlAw

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=54,294,703.60..54,294,703.61 rows=10 width=1,218) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=54,294,703.60..54,327,741.19 rows=66,075,180 width=1,218) (actual rows= loops=)

  • Sort Key: events.event_id, events.event_time DESC
3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=52,621,552.65..54,009,131.43 rows=66,075,180 width=1,218) (actual rows= loops=)

  • Group Key: events.event_id, (CASE WHEN (away_logo.logo_id IS NOT NULL) THEN concat(away_logo.logo_sport, '_', away_logo.logo_id) ELSE NULL::text END), (CASE WHEN (home_logo.logo_id IS NOT NULL) THEN concat(home_logo.logo_sport, '_', home_logo.logo_id) ELSE NULL::text END), (CASE WHEN (away.team_id IS NOT NULL) THEN away.team_city ELSE events.away_team END), away.team_name, (concat_ws(' '::text, CASE WHEN (away.team_id IS NOT NULL) THEN away.team_city ELSE events.away_team END, away.team_name)), (COALESCE(away.team_short, events.away_short)), (CASE WHEN (home.team_id IS NOT NULL) THEN home.team_city ELSE events.home_team END), home.team_name, (concat_ws(' '::text, CASE WHEN (home.team_id IS NOT NULL) THEN home.team_city ELSE events.home_team END, home.team_name)), (COALESCE(home.team_short, events.home_short)), (CASE WHEN ((picks.pick_side)::text = 'Under'::text) THEN 1 ELSE 0 END), (CASE WHEN ((picks.pick_side)::text = 'Over'::text) THEN 1 ELSE NULL::integer END), (CASE WHEN ((picks.pick_side)::text = 'Home'::text) THEN 1 ELSE NULL::integer END), (CASE WHEN ((picks.pick_side)::text = 'Away'::text) THEN 1 ELSE NULL::integer END), (CASE WHEN (((picks.pick_side)::text = 'Away'::text) OR ((picks.pick_side)::text = 'Home'::text)) THEN 1 ELSE NULL::integer END), (CASE WHEN (((picks.pick_side)::text = 'Over'::text) OR ((picks.pick_side)::text = 'Under'::text)) THEN 1 ELSE NULL::integer END), (CASE WHEN ((events.event_sport)::text = ANY ('{MLB,NHL}'::text[])) THEN events.away_money ELSE events.away_spread END), (CASE WHEN ((events.event_sport)::text = ANY ('{MLB,NHL}'::text[])) THEN events.home_money ELSE events.home_spread END), previews.preview_image
4. 0.000 0.000 ↓ 0.0

Sort (cost=52,621,552.65..52,654,590.24 rows=66,075,180 width=1,218) (actual rows= loops=)

  • Sort Key: events.event_id, (CASE WHEN (away_logo.logo_id IS NOT NULL) THEN concat(away_logo.logo_sport, '_', away_logo.logo_id) ELSE NULL::text END), (CASE WHEN (home_logo.logo_id IS NOT NULL) THEN concat(home_logo.logo_sport, '_', home_logo.logo_id) ELSE NULL::text END), (CASE WHEN (away.team_id IS NOT NULL) THEN away.team_city ELSE events.away_team END), away.team_name, (concat_ws(' '::text, CASE WHEN (away.team_id IS NOT NULL) THEN away.team_city ELSE events.away_team END, away.team_name)), (COALESCE(away.team_short, events.away_short)), (CASE WHEN (home.team_id IS NOT NULL) THEN home.team_city ELSE events.home_team END), home.team_name, (concat_ws(' '::text, CASE WHEN (home.team_id IS NOT NULL) THEN home.team_city ELSE events.home_team END, home.team_name)), (COALESCE(home.team_short, events.home_short)), (CASE WHEN ((picks.pick_side)::text = 'Under'::text) THEN 1 ELSE 0 END), (CASE WHEN ((picks.pick_side)::text = 'Over'::text) THEN 1 ELSE NULL::integer END), (CASE WHEN ((picks.pick_side)::text = 'Home'::text) THEN 1 ELSE NULL::integer END), (CASE WHEN ((picks.pick_side)::text = 'Away'::text) THEN 1 ELSE NULL::integer END), (CASE WHEN (((picks.pick_side)::text = 'Away'::text) OR ((picks.pick_side)::text = 'Home'::text)) THEN 1 ELSE NULL::integer END), (CASE WHEN (((picks.pick_side)::text = 'Over'::text) OR ((picks.pick_side)::text = 'Under'::text)) THEN 1 ELSE NULL::integer END), (CASE WHEN ((events.event_sport)::text = ANY ('{MLB,NHL}'::text[])) THEN events.away_money ELSE events.away_spread END), (CASE WHEN ((events.event_sport)::text = ANY ('{MLB,NHL}'::text[])) THEN events.home_money ELSE events.home_spread END), previews.preview_image
5. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=5,492.72..574,372.71 rows=66,075,180 width=1,218) (actual rows= loops=)

  • Merge Cond: (events.event_id = chatter.event_id)
6. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=5,492.64..48,080.64 rows=1,433,189 width=319) (actual rows= loops=)

  • Merge Cond: (events.event_id = picks.event_id)
7. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=5,492.55..5,653.97 rows=48,627 width=314) (actual rows= loops=)

  • Merge Cond: (events.event_id = previews.event_id)
8. 0.000 0.000 ↓ 0.0

Sort (cost=3,318.08..3,342.39 rows=48,627 width=224) (actual rows= loops=)

  • Sort Key: events.event_id
9. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=519.55..2,560.98 rows=48,627 width=224) (actual rows= loops=)

  • Hash Cond: (events.home_id = home_user.team_id)
10. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=301.98..2,077.71 rows=48,627 width=224) (actual rows= loops=)

  • Hash Cond: (events.away_id = away_user.team_id)
11. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=84.41..1,594.85 rows=48,627 width=224) (actual rows= loops=)

  • Hash Cond: (home.logo_id = home_logo.logo_id)
12. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=77.32..1,562.10 rows=48,627 width=220) (actual rows= loops=)

  • Hash Cond: (events.home_id = home.team_id)
13. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=42.20..1,501.37 rows=48,627 width=180) (actual rows= loops=)

  • Hash Cond: (away.logo_id = away_logo.logo_id)
14. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=35.12..1,468.62 rows=48,627 width=176) (actual rows= loops=)

  • Hash Cond: (events.away_id = away.team_id)
15. 0.000 0.000 ↓ 0.0

Seq Scan on events (cost=0.00..1,407.88 rows=48,627 width=136) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash (cost=29.13..29.13 rows=1,711 width=40) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on teams away (cost=0.00..29.13 rows=1,711 width=40) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=5.42..5.42 rows=474 width=12) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Seq Scan on team_logos away_logo (cost=0.00..5.42 rows=474 width=12) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash (cost=29.13..29.13 rows=1,711 width=40) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on teams home (cost=0.00..29.13 rows=1,711 width=40) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Hash (cost=5.42..5.42 rows=474 width=12) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on team_logos home_logo (cost=0.00..5.42 rows=474 width=12) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash (cost=195.73..195.73 rows=6,242 width=8) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on users away_user (cost=0.00..195.73 rows=6,242 width=8) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Hash (cost=195.73..195.73 rows=6,242 width=8) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Seq Scan on users home_user (cost=0.00..195.73 rows=6,242 width=8) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Sort (cost=2,174.47..2,188.57 rows=28,199 width=98) (actual rows= loops=)

  • Sort Key: previews.event_id
29. 0.000 0.000 ↓ 0.0

Seq Scan on previews (cost=0.00..1,757.60 rows=28,199 width=98) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Index Scan using public_picks_event_id2_idx on picks (cost=0.09..37,386.19 rows=1,433,189 width=13) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Materialize (cost=0.09..168,597.71 rows=2,241,880 width=16) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Index Scan using public_chatter_event_id0_idx on chatter (cost=0.09..167,476.77 rows=2,241,880 width=16) (actual rows= loops=)