explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mcHQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.985 122.020 ↑ 1,827.8 2,710 1

Hash Join (cost=5,352.09..6,968.91 rows=4,953,438 width=266) (actual time=107.196..122.020 rows=2,710 loops=1)

  • Hash Cond: (x_2.home = home_5_scores.home)
2. 1.239 91.232 ↑ 145.5 2,710 1

Hash Join (cost=3,888.94..4,448.57 rows=394,382 width=222) (actual time=77.365..91.232 rows=2,710 loops=1)

  • Hash Cond: (x.away = x_2.home)
3. 1.101 60.131 ↑ 8.3 3,773 1

Hash Join (cost=2,425.79..2,901.25 rows=31,400 width=148) (actual time=47.463..60.131 rows=3,773 loops=1)

  • Hash Cond: (x.away = away_5_scores.away)
4. 4.379 28.647 ↓ 1.5 3,773 1

GroupAggregate (cost=962.87..1,406.54 rows=2,506 width=74) (actual time=17.057..28.647 rows=3,773 loops=1)

  • Group Key: x.away
5. 0.732 24.268 ↓ 1.8 5,964 1

Subquery Scan on x (cost=962.87..1,343.57 rows=3,384 width=18) (actual time=17.037..24.268 rows=5,964 loops=1)

  • Filter: (x.r <= 3)
  • Rows Removed by Filter: 4,188
6. 5.092 23.536 ↑ 1.0 10,152 1

WindowAgg (cost=962.87..1,216.67 rows=10,152 width=230) (actual time=17.035..23.536 rows=10,152 loops=1)

7. 14.389 18.444 ↑ 1.0 10,152 1

Sort (cost=962.87..988.25 rows=10,152 width=22) (actual time=17.018..18.444 rows=10,152 loops=1)

  • Sort Key: t.away, ((t.date)::date) DESC
  • Sort Method: quicksort Memory: 1,174kB
8. 4.055 4.055 ↑ 1.0 10,152 1

Seq Scan on odds t (cost=0.00..287.28 rows=10,152 width=22) (actual time=0.033..4.055 rows=10,152 loops=1)

9. 0.933 30.383 ↓ 1.5 3,773 1

Hash (cost=1,431.60..1,431.60 rows=2,506 width=74) (actual time=30.381..30.383 rows=3,773 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 234kB
10. 0.346 29.450 ↓ 1.5 3,773 1

Subquery Scan on away_5_scores (cost=962.87..1,431.60 rows=2,506 width=74) (actual time=17.963..29.450 rows=3,773 loops=1)

11. 4.405 29.104 ↓ 1.5 3,773 1

GroupAggregate (cost=962.87..1,406.54 rows=2,506 width=74) (actual time=17.961..29.104 rows=3,773 loops=1)

  • Group Key: x_1.away
12. 0.702 24.699 ↓ 1.8 6,117 1

Subquery Scan on x_1 (cost=962.87..1,343.57 rows=3,384 width=18) (actual time=17.943..24.699 rows=6,117 loops=1)

  • Filter: (x_1.r <= 5)
  • Rows Removed by Filter: 4,035
13. 4.932 23.997 ↑ 1.0 10,152 1

WindowAgg (cost=962.87..1,216.67 rows=10,152 width=230) (actual time=17.941..23.997 rows=10,152 loops=1)

14. 14.947 19.065 ↑ 1.0 10,152 1

Sort (cost=962.87..988.25 rows=10,152 width=22) (actual time=17.924..19.065 rows=10,152 loops=1)

  • Sort Key: t_1.away, ((t_1.date)::date) DESC
  • Sort Method: quicksort Memory: 1,174kB
15. 4.118 4.118 ↑ 1.0 10,152 1

Seq Scan on odds t_1 (cost=0.00..287.28 rows=10,152 width=22) (actual time=0.026..4.118 rows=10,152 loops=1)

16. 0.895 29.862 ↓ 1.5 3,795 1

Hash (cost=1,431.75..1,431.75 rows=2,512 width=74) (actual time=29.858..29.862 rows=3,795 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 236kB
17. 4.660 28.967 ↓ 1.5 3,795 1

GroupAggregate (cost=962.87..1,406.63 rows=2,512 width=74) (actual time=17.448..28.967 rows=3,795 loops=1)

  • Group Key: x_2.home
18. 0.704 24.307 ↓ 1.8 5,952 1

Subquery Scan on x_2 (cost=962.87..1,343.57 rows=3,384 width=18) (actual time=17.429..24.307 rows=5,952 loops=1)

  • Filter: (x_2.r <= 3)
  • Rows Removed by Filter: 4,200
19. 5.076 23.603 ↑ 1.0 10,152 1

WindowAgg (cost=962.87..1,216.67 rows=10,152 width=230) (actual time=17.427..23.603 rows=10,152 loops=1)

20. 14.243 18.527 ↑ 1.0 10,152 1

Sort (cost=962.87..988.25 rows=10,152 width=22) (actual time=17.407..18.527 rows=10,152 loops=1)

  • Sort Key: t_2.home, ((t_2.date)::date) DESC
  • Sort Method: quicksort Memory: 1,174kB
21. 4.284 4.284 ↑ 1.0 10,152 1

Seq Scan on odds t_2 (cost=0.00..287.28 rows=10,152 width=22) (actual time=0.031..4.284 rows=10,152 loops=1)

22. 0.883 29.803 ↓ 1.5 3,795 1

Hash (cost=1,431.75..1,431.75 rows=2,512 width=74) (actual time=29.799..29.803 rows=3,795 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 235kB
23. 0.361 28.920 ↓ 1.5 3,795 1

Subquery Scan on home_5_scores (cost=962.87..1,431.75 rows=2,512 width=74) (actual time=17.555..28.920 rows=3,795 loops=1)

24. 4.303 28.559 ↓ 1.5 3,795 1

GroupAggregate (cost=962.87..1,406.63 rows=2,512 width=74) (actual time=17.554..28.559 rows=3,795 loops=1)

  • Group Key: x_3.home
25. 0.729 24.256 ↓ 1.8 6,114 1

Subquery Scan on x_3 (cost=962.87..1,343.57 rows=3,384 width=18) (actual time=17.537..24.256 rows=6,114 loops=1)

  • Filter: (x_3.r <= 5)
  • Rows Removed by Filter: 4,038
26. 4.956 23.527 ↑ 1.0 10,152 1

WindowAgg (cost=962.87..1,216.67 rows=10,152 width=230) (actual time=17.535..23.527 rows=10,152 loops=1)

27. 14.484 18.571 ↑ 1.0 10,152 1

Sort (cost=962.87..988.25 rows=10,152 width=22) (actual time=17.519..18.571 rows=10,152 loops=1)

  • Sort Key: t_3.home, ((t_3.date)::date) DESC
  • Sort Method: quicksort Memory: 1,174kB
28. 4.087 4.087 ↑ 1.0 10,152 1

Seq Scan on odds t_3 (cost=0.00..287.28 rows=10,152 width=22) (actual time=0.022..4.087 rows=10,152 loops=1)

Planning time : 1.378 ms
Execution time : 122.807 ms