explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Ung

Settings
# exclusive inclusive rows x rows loops node
1. 0.424 14.662 ↑ 1.1 442 1

Hash Left Join (cost=79.63..195,899.18 rows=488 width=1,135) (actual time=0.432..14.662 rows=442 loops=1)

  • Hash Cond: (competitions.id = competition_metadata.competition_id)
2. 0.149 0.854 ↓ 1.0 442 1

Hash Left Join (cost=56.68..523.43 rows=440 width=1,011) (actual time=0.219..0.854 rows=442 loops=1)

  • Hash Cond: (competitions.id = competitions_lookup.competition_id)
3. 0.498 0.498 ↓ 1.0 442 1

Seq Scan on competitions (cost=0.00..465.58 rows=440 width=963) (actual time=0.006..0.498 rows=442 loops=1)

  • Filter: ((league_id = ANY ('{22,23}'::integer[])) AND (status <> ALL ('{flex-schedule,unnecessary}'::game_status_type[])))
  • Rows Removed by Filter: 197
4. 0.088 0.207 ↓ 1.1 639 1

Hash (cost=49.08..49.08 rows=608 width=48) (actual time=0.207..0.207 rows=639 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 33kB
5. 0.119 0.119 ↓ 1.1 639 1

Seq Scan on competitions_lookup (cost=0.00..49.08 rows=608 width=48) (actual time=0.004..0.119 rows=639 loops=1)

6. 0.070 0.124 ↑ 1.1 639 1

Hash (cost=14.09..14.09 rows=709 width=60) (actual time=0.124..0.124 rows=639 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 60kB
7. 0.054 0.054 ↑ 1.1 639 1

Seq Scan on competition_metadata (cost=0.00..14.09 rows=709 width=60) (actual time=0.003..0.054 rows=639 loops=1)

8.          

SubPlan (for Hash Left Join)

9. 0.000 1.768 ↑ 1.0 1 442

Aggregate (cost=4.44..4.45 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=442)

10. 1.768 1.768 ↓ 0.0 0 442

Seq Scan on latest_competition_odds odds (cost=0.00..4.43 rows=1 width=695) (actual time=0.004..0.004 rows=0 loops=442)

  • Filter: ((book_id = ANY ('{15,30}'::integer[])) AND (competitions.id = competition_id))
  • Rows Removed by Filter: 29
11. 2.210 11.492 ↑ 1.0 1 442

Aggregate (cost=395.85..395.86 rows=1 width=32) (actual time=0.026..0.026 rows=1 loops=442)

12. 0.884 2.210 ↑ 11.0 2 442

Nested Loop (cost=0.70..210.17 rows=22 width=20) (actual time=0.003..0.005 rows=2 loops=442)

13. 0.442 0.442 ↑ 11.0 2 442

Index Scan using idx_competitors_competition_id on competitors (cost=0.29..44.60 rows=22 width=20) (actual time=0.001..0.001 rows=2 loops=442)

  • Index Cond: (competition_id = competitions.id)
14. 0.884 0.884 ↑ 1.0 1 884

Index Only Scan using players_pkey on players players_1 (cost=0.42..7.53 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=884)

  • Index Cond: (id = competitors.player_id)
  • Heap Fetches: 884
15.          

SubPlan (for Aggregate)

16. 7.072 7.072 ↑ 1.0 1 884

Index Scan using players_pkey on players (cost=0.42..8.44 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=884)

  • Index Cond: (id = competitors.player_id)
Planning time : 0.634 ms
Execution time : 14.790 ms