explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sLCv

Settings
# exclusive inclusive rows x rows loops node
1. 1,780.702 19,934.656 ↑ 83.7 55,248 1

GroupAggregate (cost=1,027,371.95..1,224,000.67 rows=4,626,558 width=72) (actual time=16,673.049..19,934.656 rows=55,248 loops=1)

  • Group Key: (to_timestamp((floor((date_part('epoch'::text, stats_players.created_at) / '6'::double precision)) * '6'::double precision)))
2. 4,951.557 18,153.954 ↓ 2.3 10,539,060 1

Sort (cost=1,027,371.95..1,038,938.35 rows=4,626,558 width=12) (actual time=16,673.005..18,153.954 rows=10,539,060 loops=1)

  • Sort Key: (to_timestamp((floor((date_part('epoch'::text, stats_players.created_at) / '6'::double precision)) * '6'::double precision)))
  • Sort Method: external merge Disk: 227032kB
3. 6,765.953 13,202.397 ↓ 2.3 10,539,060 1

Hash Join (cost=9,007.17..468,865.55 rows=4,626,558 width=12) (actual time=164.388..13,202.397 rows=10,539,060 loops=1)

  • Hash Cond: (stats_players.server_id = game_servers.id)
4. 6,272.263 6,272.263 ↓ 1.1 10,539,060 1

Index Scan using stats_players_created_at_idx on stats_players (cost=0.56..321,062.40 rows=9,253,115 width=16) (actual time=0.022..6,272.263 rows=10,539,060 loops=1)

  • Index Cond: ((created_at >= '2019-10-06 23:49:32.826'::timestamp without time zone) AND (created_at <= '2019-11-07 11:49:32.826'::timestamp without time zone))
5. 58.915 164.181 ↓ 1.9 236,300 1

Hash (cost=7,464.83..7,464.83 rows=123,342 width=4) (actual time=164.181..164.181 rows=236,300 loops=1)

  • Buckets: 262144 (originally 131072) Batches: 1 (originally 1) Memory Usage: 10356kB
6. 49.665 105.266 ↓ 1.9 236,300 1

Hash Join (cost=17.25..7,464.83 rows=123,342 width=4) (actual time=0.810..105.266 rows=236,300 loops=1)

  • Hash Cond: (game_servers.cluster_id = grafana_cluster_selector.id)
7. 55.474 55.474 ↓ 1.0 246,721 1

Seq Scan on game_servers (cost=0.00..5,427.85 rows=246,685 width=8) (actual time=0.027..55.474 rows=246,721 loops=1)

8. 0.004 0.127 ↑ 28.6 7 1

Hash (cost=14.75..14.75 rows=200 width=2) (actual time=0.126..0.127 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.009 0.123 ↑ 28.6 7 1

HashAggregate (cost=12.75..14.75 rows=200 width=2) (actual time=0.120..0.123 rows=7 loops=1)

  • Group Key: grafana_cluster_selector.id
10. 0.114 0.114 ↑ 142.9 7 1

Function Scan on grafana_cluster_selector (cost=0.25..10.25 rows=1,000 width=2) (actual time=0.113..0.114 rows=7 loops=1)

Planning time : 0.498 ms
Execution time : 19,980.724 ms