explain.depesz.com

PostgreSQL's explain analyze made readable

Result: S6SW

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 14.872 ↑ 166.7 6 1

Merge Left Join (cost=18,378.98..18,398.98 rows=1,000 width=200) (actual time=14.868..14.872 rows=6 loops=1)

  • Merge Cond: (dt.dt = t1.month)
2.          

CTE stats

3. 6.442 8.672 ↑ 1.0 3,715 1

Hash Left Join (cost=17,934.97..18,154.87 rows=3,715 width=261) (actual time=1.370..8.672 rows=3,715 loops=1)

  • Hash Cond: ((t1_1.project_id = t3.project_id) AND (t1_1.month = t3.month))
4. 0.896 0.896 ↑ 1.0 3,715 1

Seq Scan on app_projectoverview t1_1 (cost=0.00..99.15 rows=3,715 width=53) (actual time=0.014..0.896 rows=3,715 loops=1)

5. 0.000 1.334 ↓ 0.0 0 1

Hash (cost=17,934.93..17,934.93 rows=3 width=216) (actual time=1.334..1.334 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
6. 0.000 1.334 ↓ 0.0 0 1

Subquery Scan on t3 (cost=17,934.83..17,934.93 rows=3 width=216) (actual time=1.334..1.334 rows=0 loops=1)

7. 0.001 1.334 ↓ 0.0 0 1

HashAggregate (cost=17,934.83..17,934.90 rows=3 width=39) (actual time=1.334..1.334 rows=0 loops=1)

  • Group Key: t4.project_id, t4.month, t4.currency_code
8. 1.146 1.333 ↓ 0.0 0 1

Nested Loop (cost=0.56..17,934.68 rows=3 width=39) (actual time=1.333..1.333 rows=0 loops=1)

9. 0.187 0.187 ↑ 1.0 1,249 1

Seq Scan on app_testplayer t5 (cost=0.00..24.49 rows=1,249 width=25) (actual time=0.001..0.187 rows=1,249 loops=1)

10. 0.000 0.000 ↓ 0.0 0 1,249

Index Scan using app_playerdailystat_project_id_day_currency__9b0effbe_uniq on app_playerdailystat t4 (cost=0.56..14.33 rows=1 width=53) (actual time=0.000..0.000 rows=0 loops=1,249)

  • Index Cond: ((project_id = t5.project_id) AND (project_id = ANY ('{1,2}'::integer[])) AND ((currency_code)::text = 'EUR'::text) AND ((player_id)::text = (t5.player_id)::text))
  • Filter: (month >= '2018-09-01 00:00:00'::timestamp without time zone)
11. 0.017 0.042 ↑ 166.7 6 1

Sort (cost=59.86..62.36 rows=1,000 width=8) (actual time=0.041..0.042 rows=6 loops=1)

  • Sort Key: dt.dt
  • Sort Method: quicksort Memory: 25kB
12. 0.025 0.025 ↑ 166.7 6 1

Function Scan on generate_series dt (cost=0.03..10.03 rows=1,000 width=8) (actual time=0.024..0.025 rows=6 loops=1)

13. 0.040 14.819 ↑ 5.6 36 1

Sort (cost=164.24..164.74 rows=200 width=196) (actual time=14.817..14.819 rows=36 loops=1)

  • Sort Key: t1.month
  • Sort Method: quicksort Memory: 29kB
14. 0.009 14.779 ↑ 5.6 36 1

Subquery Scan on t1 (cost=148.60..156.60 rows=200 width=196) (actual time=14.753..14.779 rows=36 loops=1)

15. 3.888 14.770 ↑ 5.6 36 1

HashAggregate (cost=148.60..154.60 rows=200 width=196) (actual time=14.752..14.770 rows=36 loops=1)

  • Group Key: stats.month
16. 10.882 10.882 ↑ 1.0 3,715 1

CTE Scan on stats (cost=0.00..74.30 rows=3,715 width=196) (actual time=1.373..10.882 rows=3,715 loops=1)