explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RD6G

Settings
# exclusive inclusive rows x rows loops node
1. 0.048 0.522 ↑ 1.7 29 1

Nested Loop Left Join (cost=11.05..1,818.64 rows=49 width=272) (actual time=0.083..0.522 rows=29 loops=1)

2. 0.029 0.416 ↑ 1.7 29 1

Nested Loop Left Join (cost=10.77..1,409.85 rows=49 width=136) (actual time=0.073..0.416 rows=29 loops=1)

3. 0.013 0.358 ↑ 1.7 29 1

Nested Loop Left Join (cost=10.48..1,002.05 rows=49 width=52) (actual time=0.069..0.358 rows=29 loops=1)

4. 0.028 0.345 ↑ 1.7 29 1

Nested Loop Left Join (cost=10.20..993.13 rows=49 width=44) (actual time=0.064..0.345 rows=29 loops=1)

5. 0.236 0.259 ↑ 1.7 29 1

Bitmap Heap Scan on words_games g (cost=9.91..642.19 rows=49 width=36) (actual time=0.058..0.259 rows=29 loops=1)

  • Recheck Cond: ((5 = player1) OR (5 = player2))
  • Filter: (finished > (CURRENT_TIMESTAMP - '3 mons'::interval))
  • Rows Removed by Filter: 231
  • Heap Blocks: exact=183
6. 0.000 0.023 ↓ 0.0 0 1

BitmapOr (cost=9.91..9.91 rows=174 width=0) (actual time=0.023..0.023 rows=0 loops=1)

7. 0.013 0.013 ↓ 8.6 103 1

Bitmap Index Scan on words_games_player1_coalesce_idx (cost=0.00..4.38 rows=12 width=0) (actual time=0.013..0.013 rows=103 loops=1)

  • Index Cond: (5 = player1)
8. 0.010 0.010 ↓ 1.1 175 1

Bitmap Index Scan on words_games_player2_coalesce_idx (cost=0.00..5.50 rows=162 width=0) (actual time=0.010..0.010 rows=175 loops=1)

  • Index Cond: (5 = player2)
9. 0.058 0.058 ↑ 1.0 1 29

Index Scan using words_users_pkey on words_users u2 (cost=0.29..7.16 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=29)

  • Index Cond: (uid = CASE WHEN (g.player1 = 5) THEN g.player2 ELSE g.player1 END)
10. 0.000 0.000 ↑ 1.0 1 29

Materialize (cost=0.29..8.31 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=29)

11. 0.004 0.004 ↑ 1.0 1 1

Index Scan using words_users_pkey on words_users u1 (cost=0.29..8.30 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (uid = 5)
12. 0.000 0.029 ↑ 1.0 1 29

Limit (cost=0.29..8.30 rows=1 width=180) (actual time=0.001..0.001 rows=1 loops=29)

13. 0.029 0.029 ↑ 1.0 1 29

Index Scan using words_social_uid_stamp_idx on words_social s1 (cost=0.29..8.30 rows=1 width=180) (actual time=0.001..0.001 rows=1 loops=29)

  • Index Cond: (uid = u1.uid)
14. 0.000 0.058 ↑ 1.0 1 29

Limit (cost=0.29..8.30 rows=1 width=180) (actual time=0.002..0.002 rows=1 loops=29)

15. 0.058 0.058 ↑ 1.0 1 29

Index Scan using words_social_uid_stamp_idx on words_social s2 (cost=0.29..8.30 rows=1 width=180) (actual time=0.001..0.002 rows=1 loops=29)

  • Index Cond: (uid = u2.uid)