explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2hs

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 0.230 ↑ 1.0 10 1

Limit (cost=2.29..485.58 rows=10 width=495) (actual time=0.044..0.230 rows=10 loops=1)

2. 0.030 0.227 ↑ 272.0 10 1

WindowAgg (cost=2.29..131,458.11 rows=2,720 width=495) (actual time=0.043..0.227 rows=10 loops=1)

3. 0.006 0.197 ↑ 272.0 10 1

Nested Loop Left Join (cost=2.29..131,376.51 rows=2,720 width=435) (actual time=0.034..0.197 rows=10 loops=1)

4. 0.000 0.181 ↑ 68.0 10 1

Nested Loop Left Join (cost=1.72..131,306.98 rows=680 width=347) (actual time=0.024..0.181 rows=10 loops=1)

5. 0.000 0.151 ↑ 68.0 10 1

Nested Loop Left Join (cost=1.29..125,772.38 rows=680 width=143) (actual time=0.020..0.151 rows=10 loops=1)

6. 0.005 0.111 ↑ 68.0 10 1

Nested Loop Left Join (cost=0.72..125,154.46 rows=680 width=55) (actual time=0.014..0.111 rows=10 loops=1)

7. 0.086 0.086 ↑ 68.0 10 1

Index Scan using words_scores_length_mid_idx on words_scores s (cost=0.43..121,541.36 rows=680 width=23) (actual time=0.010..0.086 rows=10 loops=1)

  • Filter: (uid = 5)
  • Rows Removed by Filter: 129
8. 0.020 0.020 ↑ 1.0 1 10

Index Scan using words_games_pkey on words_games g (cost=0.29..5.31 rows=1 width=36) (actual time=0.002..0.002 rows=1 loops=10)

  • Index Cond: (s.gid = gid)
9. 0.009 0.040 ↑ 1.0 1 10

Nested Loop Anti Join (cost=0.57..0.90 rows=1 width=92) (actual time=0.003..0.004 rows=1 loops=10)

10. 0.020 0.020 ↑ 1.0 1 10

Index Scan using words_social_uid_stamp_idx on words_social s2 (cost=0.29..0.33 rows=1 width=96) (actual time=0.002..0.002 rows=1 loops=10)

  • Index Cond: (uid = CASE WHEN (g.player1 = 5) THEN g.player2 ELSE g.player1 END)
11. 0.011 0.011 ↓ 0.0 0 11

Index Only Scan using words_social_uid_stamp_idx on words_social s_2 (cost=0.29..0.43 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=11)

  • Index Cond: ((uid = s2.uid) AND (stamp > s2.stamp))
  • Heap Fetches: 1
12. 0.030 0.030 ↑ 1.0 1 10

Index Scan using words_moves_pkey on words_moves m (cost=0.43..8.14 rows=1 width=212) (actual time=0.003..0.003 rows=1 loops=10)

  • Index Cond: (s.mid = mid)
13. 0.000 0.010 ↑ 4.0 1 10

Materialize (cost=0.57..35.54 rows=4 width=88) (actual time=0.001..0.001 rows=1 loops=10)

14. 0.002 0.012 ↑ 4.0 1 1

Nested Loop Anti Join (cost=0.57..35.52 rows=4 width=88) (actual time=0.009..0.012 rows=1 loops=1)

  • Join Filter: ((s_1.stamp > s1.stamp) AND (s1.uid = s_1.uid))
  • Rows Removed by Join Filter: 6
15. 0.004 0.004 ↑ 1.0 6 1

Index Scan using words_social_uid_stamp_idx on words_social s1 (cost=0.29..17.51 rows=6 width=96) (actual time=0.002..0.004 rows=6 loops=1)

  • Index Cond: (uid = 5)
16. 0.001 0.006 ↑ 3.0 2 6

Materialize (cost=0.29..17.54 rows=6 width=8) (actual time=0.000..0.001 rows=2 loops=6)

17. 0.005 0.005 ↑ 1.0 6 1

Index Only Scan using words_social_uid_stamp_idx on words_social s_1 (cost=0.29..17.51 rows=6 width=8) (actual time=0.002..0.005 rows=6 loops=1)

  • Index Cond: (uid = 5)
  • Heap Fetches: 6