explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OyM1

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 41,826.870 ↓ 0.0 0 1

Sort (cost=18,888.79..18,888.79 rows=1 width=65) (actual time=41,826.870..41,826.870 rows=0 loops=1)

  • Sort Key: b.createdt
  • Sort Method: quicksort Memory: 25kB
2. 2,707.008 41,826.861 ↓ 0.0 0 1

GroupAggregate (cost=18,888.03..18,888.78 rows=1 width=65) (actual time=41,826.861..41,826.861 rows=0 loops=1)

  • Group Key: b.id, pc.firstname, pc.middlename, pc.lastname, pc.playersegmentid
  • Filter: (max(c.status) = 2)
  • Rows Removed by Filter: 30170
3. 16,602.528 39,119.853 ↓ 237,725.9 5,943,148 1

Sort (cost=18,888.03..18,888.09 rows=25 width=69) (actual time=37,239.199..39,119.853 rows=5,943,148 loops=1)

  • Sort Key: b.id, pc.firstname, pc.middlename, pc.lastname, pc.playersegmentid
  • Sort Method: external merge Disk: 493144kB
4. 2,388.424 22,517.325 ↓ 237,725.9 5,943,148 1

Nested Loop Left Join (cost=1.12..18,887.45 rows=25 width=69) (actual time=0.220..22,517.325 rows=5,943,148 loops=1)

5. 20.930 397.721 ↓ 1,774.7 30,170 1

Nested Loop (cost=0.56..18,774.96 rows=17 width=65) (actual time=0.158..397.721 rows=30,170 loops=1)

6. 3.470 3.470 ↑ 1.0 2,209 1

Seq Scan on playercard pc (cost=0.00..106.13 rows=2,209 width=53) (actual time=0.025..3.470 rows=2,209 loops=1)

  • Filter: isvip
  • Rows Removed by Filter: 104
7. 373.321 373.321 ↓ 14.0 14 2,209

Index Scan using ix_balance_playerid_account_processed_createdt on balance b (cost=0.56..8.44 rows=1 width=20) (actual time=0.033..0.169 rows=14 loops=2,209)

  • Index Cond: ((playerid = pc.playerid) AND (account = pc.account) AND (processed = false))
  • Filter: ((NOT processed) AND (status = 2))
  • Rows Removed by Filter: 66
8. 19,731.180 19,731.180 ↓ 197.0 197 30,170

Index Scan using ix_balance_playerid_account_processed_createdt on balance c (cost=0.56..6.61 rows=1 width=20) (actual time=0.019..0.654 rows=197 loops=30,170)

  • Index Cond: ((b.playerid = playerid) AND (b.account = account) AND (createdt <= b.createdt) AND (createdt >= (b.createdt - '168:00:00'::interval)))
Planning time : 3.892 ms
Execution time : 41,997.102 ms