explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bQab

Settings
# exclusive inclusive rows x rows loops node
1. 0.109 1,249.206 ↓ 3.0 118 1

Sort (cost=347,702.01..347,702.11 rows=40 width=82) (actual time=1,249.198..1,249.206 rows=118 loops=1)

  • Sort Key: ((round((sum(((l.is_winner)::integer)::numeric) / (sum(1))::numeric), 4) * '100'::numeric)) DESC
  • Sort Method: quicksort Memory: 34kB
  • Functions: 70
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 13.186 ms, Inlining 0.000 ms, Optimization 3.833 ms, Emission 82.347 ms, Total 99.366 ms
2. 5.563 1,249.097 ↓ 3.0 118 1

HashAggregate (cost=34,652.83..347,700.94 rows=40 width=82) (actual time=200.267..1,249.097 rows=118 loops=1)

  • Group Key: h.hero_id
  • Filter: (sum(1) >= 1)
3. 21.395 179.174 ↑ 1.4 19,088 1

Gather (cost=5,542.22..34,034.32 rows=27,489 width=3) (actual time=58.285..179.174 rows=19,088 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 61.149 157.779 ↑ 1.8 6,363 3 / 3

Parallel Hash Join (cost=4,542.22..30,285.42 rows=11,454 width=3) (actual time=35.465..157.779 rows=6,363 loops=3)

  • Hash Cond: ((h.match_id = l.match_id) AND (h.side = l.side))
5. 61.895 61.895 ↑ 1.2 479,379 3 / 3

Parallel Seq Scan on heroes h (cost=0.00..16,712.15 rows=598,888 width=12) (actual time=0.027..61.895 rows=479,379 loops=3)

  • Filter: (hero_id <> 72)
  • Rows Removed by Filter: 1,591
6. 1.871 34.735 ↑ 1.5 1,591 3 / 3

Parallel Hash (cost=4,507.35..4,507.35 rows=2,325 width=11) (actual time=34.734..34.735 rows=1,591 loops=3)

  • Buckets: 8,192 Batches: 1 Memory Usage: 384kB
7. 32.404 32.864 ↑ 1.5 1,591 3 / 3

Parallel Bitmap Heap Scan on heroes l (cost=61.26..4,507.35 rows=2,325 width=11) (actual time=30.017..32.864 rows=1,591 loops=3)

  • Recheck Cond: (hero_id = 72)
  • Heap Blocks: exact=3,387
8. 0.460 0.460 ↑ 1.2 4,772 1 / 3

Bitmap Index Scan on heroes_hero_id_index (cost=0.00..59.87 rows=5,579 width=0) (actual time=1.379..1.379 rows=4,772 loops=1)

  • Index Cond: (hero_id = 72)
9.          

SubPlan (for HashAggregate)

10. 0.118 1,064.360 ↑ 119.0 1 118

Subquery Scan on t1 (cost=131.80..7,826.15 rows=119 width=32) (actual time=9.020..9.020 rows=1 loops=118)

11. 229.510 1,064.242 ↑ 119.0 1 118

GroupAggregate (cost=131.80..7,824.96 rows=119 width=34) (actual time=9.019..9.019 rows=1 loops=118)

  • Group Key: heroes.hero_id
12. 748.356 834.732 ↓ 1.0 12,188 118

Bitmap Heap Scan on heroes (cost=131.80..7,670.72 rows=12,125 width=3) (actual time=1.353..7.074 rows=12,188 loops=118)

  • Recheck Cond: (hero_id = h.hero_id)
  • Heap Blocks: exact=695,515
13. 86.376 86.376 ↓ 1.0 12,188 118

Bitmap Index Scan on heroes_hero_id_index (cost=0.00..128.77 rows=12,125 width=0) (actual time=0.732..0.732 rows=12,188 loops=118)

  • Index Cond: (hero_id = h.hero_id)
Execution time : 1,256.720 ms