explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Vx9k

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

Limit (cost=17,284.06..17,284.09 rows=10 width=495) (actual time=29.399..29.401 rows=10 loops=1)

2. 1.379 29.398 ↑ 68.0 10 1

Sort (cost=17,284.06..17,285.76 rows=680 width=495) (actual time=29.398..29.398 rows=10 loops=1)

  • Sort Key: (length(s.word)) DESC, s.mid DESC
  • Sort Method: top-N heapsort Memory: 38kB
3. 7.240 28.019 ↓ 5.5 3,711 1

WindowAgg (cost=1.72..17,269.37 rows=680 width=495) (actual time=0.045..28.019 rows=3,711 loops=1)

4. 1.606 20.779 ↓ 5.5 3,711 1

Nested Loop Left Join (cost=1.72..17,248.97 rows=680 width=435) (actual time=0.031..20.779 rows=3,711 loops=1)

5. 0.917 15.462 ↓ 5.5 3,711 1

Nested Loop Left Join (cost=1.43..11,587.97 rows=680 width=347) (actual time=0.027..15.462 rows=3,711 loops=1)

6. 0.908 14.545 ↓ 5.5 3,711 1

Nested Loop Left Join (cost=1.15..11,576.30 rows=680 width=259) (actual time=0.022..14.545 rows=3,711 loops=1)

7. 1.148 6.215 ↓ 5.5 3,711 1

Nested Loop Left Join (cost=0.72..6,041.70 rows=680 width=55) (actual time=0.018..6.215 rows=3,711 loops=1)

8. 1.356 1.356 ↓ 5.5 3,711 1

Index Scan using words_scores_uid_idx on words_scores s (cost=0.43..2,428.60 rows=680 width=23) (actual time=0.013..1.356 rows=3,711 loops=1)

  • Index Cond: (uid = 5)
9. 3.711 3.711 ↑ 1.0 1 3,711

Index Scan using words_games_pkey on words_games g (cost=0.29..5.31 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=3,711)

  • Index Cond: (s.gid = gid)
10. 7.422 7.422 ↑ 1.0 1 3,711

Index Scan using words_moves_pkey on words_moves m (cost=0.43..8.14 rows=1 width=212) (actual time=0.002..0.002 rows=1 loops=3,711)

  • Index Cond: (s.mid = mid)
11. 0.000 0.000 ↑ 1.0 1 3,711

Materialize (cost=0.29..3.17 rows=1 width=88) (actual time=0.000..0.000 rows=1 loops=3,711)

12. 0.000 0.004 ↑ 1.0 1 1

Subquery Scan on s1 (cost=0.29..3.17 rows=1 width=88) (actual time=0.004..0.004 rows=1 loops=1)

13. 0.000 0.004 ↑ 1.0 1 1

Limit (cost=0.29..3.16 rows=1 width=180) (actual time=0.004..0.004 rows=1 loops=1)

14. 0.004 0.004 ↑ 6.0 1 1

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

  • Index Cond: (uid = 5)
15. 0.000 3.711 ↑ 1.0 1 3,711

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

16. 3.711 3.711 ↑ 1.0 1 3,711

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.001 rows=1 loops=3,711)

  • Index Cond: (uid = CASE WHEN (g.player1 = 5) THEN g.player2 ELSE g.player1 END)