explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g8Nk : dwdw

Settings
# exclusive inclusive rows x rows loops node
1. 4.545 23.362 ↑ 40.0 5 1

HashAggregate (cost=1,209.59..1,212.09 rows=200 width=64) (actual time=23.315..23.362 rows=5 loops=1)

  • Group Key: ucards.""position"
2.          

CTE ucards

3. 6.885 17.711 ↑ 7.9 1,332 1

HashAggregate (cost=817.23..921.86 rows=10,463 width=42) (actual time=17.130..17.711 rows=1,332 loops=1)

  • Group Key: uc.card_id, c.name, c.is_boost, c.is_boost_team, p.""position"
4. 2.998 10.826 ↓ 1.0 10,470 1

Hash Left Join (cost=364.00..660.28 rows=10,463 width=38) (actual time=1.680..10.826 rows=10,470 loops=1)

  • Hash Cond: (c.player_id = p.id)
5. 3.826 7.243 ↓ 1.0 10,470 1

Hash Join (cost=129.97..398.61 rows=10,463 width=37) (actual time=1.084..7.243 rows=10,470 loops=1)

  • Hash Cond: (uc.card_id = c.id)
6. 2.575 2.575 ↑ 1.0 10,470 1

Seq Scan on users_cards uc (cost=0.00..241.06 rows=10,471 width=12) (actual time=0.230..2.575 rows=10,470 loops=1)

  • Filter: ((linedup_event_id IS NULL) AND (user_id = 2))
  • Rows Removed by Filter: 2,255
7. 0.314 0.842 ↑ 1.0 1,332 1

Hash (cost=113.32..113.32 rows=1,332 width=29) (actual time=0.842..0.842 rows=1,332 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 100kB
8. 0.528 0.528 ↑ 1.0 1,332 1

Seq Scan on cards c (cost=0.00..113.32 rows=1,332 width=29) (actual time=0.005..0.528 rows=1,332 loops=1)

9. 0.164 0.585 ↑ 1.0 668 1

Hash (cost=225.68..225.68 rows=668 width=13) (actual time=0.585..0.585 rows=668 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 39kB
10. 0.421 0.421 ↑ 1.0 668 1

Seq Scan on opta_players p (cost=0.00..225.68 rows=668 width=13) (actual time=0.008..0.421 rows=668 loops=1)

11. 18.817 18.817 ↑ 7.9 1,332 1

CTE Scan on ucards (cost=0.00..209.26 rows=10,463 width=88) (actual time=17.150..18.817 rows=1,332 loops=1)

Planning time : 0.798 ms
Execution time : 23.579 ms