explain.depesz.com

A tool for finding a real cause for slow queries.

Result: KVr

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 132.520 362,635.091 ↓ 3.9 123,117 1

Sort (cost=3,044,088.10..3,044,166.20 rows=31,240 width=104) (actual time=362,616.368..362,635.091 rows=123,117 loops=1)

  • Sort Key: part.id_game
  • Sort Method: quicksort Memory: 20386kB
2. 236.659 362,502.571 ↓ 3.9 123,117 1

HashAggregate (cost=3,041,443.46..3,041,755.86 rows=31,240 width=104) (actual time=362,443.737..362,502.571 rows=123,117 loops=1)

3. 15.751 362,265.912 ↓ 4.0 124,075 1

Append (cost=1,517,714.92..3,039,803.36 rows=31,240 width=104) (actual time=171,519.344..362,265.912 rows=124,075 loops=1)

4. 44.720 172,063.413 ↓ 4.0 61,939 1

Subquery Scan part (cost=1,517,714.92..1,519,745.48 rows=15,620 width=104) (actual time=171,519.343..172,063.413 rows=61,939 loops=1)

  • Filter: (part.r <= 1000)
5. 488.650 172,018.693 ↓ 5.4 251,827 1

WindowAgg (cost=1,517,714.92..1,519,120.69 rows=46,859 width=94) (actual time=171,519.339..172,018.693 rows=251,827 loops=1)

6. 562.955 171,530.043 ↓ 5.4 251,827 1

Sort (cost=1,517,714.92..1,517,832.07 rows=46,859 width=94) (actual time=171,497.852..171,530.043 rows=251,827 loops=1)

  • Sort Key: public.games.w_user, public.games.id_game
  • Sort Method: quicksort Memory: 41558kB
7. 316.627 170,967.088 ↓ 5.4 251,827 1

Hash Join (cost=479,014.57..1,514,079.59 rows=46,859 width=94) (actual time=84,313.951..170,967.088 rows=251,827 loops=1)

  • Hash Cond: (public.games.b_user = u2.id_user)
8. 517.354 170,507.082 ↓ 5.4 251,827 1

Hash Join (cost=474,284.42..1,508,470.83 rows=46,859 width=73) (actual time=84,170.453..170,507.082 rows=251,827 loops=1)

  • Hash Cond: (public.games.w_user = u1.id_user)
9. 86,015.679 169,972.114 ↓ 22.3 2,091,568 1

Bitmap Heap Scan on games (cost=470,600.70..1,503,498.49 rows=93,718 width=52) (actual time=84,152.722..169,972.114 rows=2,091,568 loops=1)

  • Recheck Cond: ((total_time = 180::double precision) AND (increment = 0::double precision))
  • Filter: (stockfish_analysed AND stockfish_analysed AND (ply_count > 10))
10. 83,956.435 83,956.435 ↓ 1.2 19,861,183 1

Bitmap Index Scan on index_total_increment (cost=0.00..470,577.28 rows=16,807,988 width=0) (actual time=83,956.435..83,956.435 rows=19,861,183 loops=1)

  • Index Cond: ((total_time = 180::double precision) AND (increment = 0::double precision))
11. 0.045 17.614 ↑ 1,195.9 70 1

Hash (cost=2,637.29..2,637.29 rows=83,714 width=25) (actual time=17.614..17.614 rows=70 loops=1)

12. 17.569 17.569 ↑ 1,195.9 70 1

Seq Scan on users u1 (cost=0.00..2,637.29 rows=83,714 width=25) (actual time=16.420..17.569 rows=70 loops=1)

  • Filter: has_chronotype
13. 40.479 143.379 ↑ 1.0 167,255 1

Hash (cost=2,637.29..2,637.29 rows=167,429 width=25) (actual time=143.379..143.379 rows=167,255 loops=1)

14. 102.900 102.900 ↑ 1.0 167,255 1

Seq Scan on users u2 (cost=0.00..2,637.29 rows=167,429 width=25) (actual time=18.048..102.900 rows=167,255 loops=1)

15. 44.777 190,186.748 ↓ 4.0 62,136 1

Subquery Scan part (cost=1,517,714.92..1,519,745.48 rows=15,620 width=104) (actual time=189,633.835..190,186.748 rows=62,136 loops=1)

  • Filter: (part.r <= 1000)
16. 474.941 190,141.971 ↓ 5.4 254,125 1

WindowAgg (cost=1,517,714.92..1,519,120.69 rows=46,859 width=94) (actual time=189,633.831..190,141.971 rows=254,125 loops=1)

17. 559.316 189,667.030 ↓ 5.4 254,125 1

Sort (cost=1,517,714.92..1,517,832.07 rows=46,859 width=94) (actual time=189,633.805..189,667.030 rows=254,125 loops=1)

  • Sort Key: public.games.b_user, public.games.id_game
  • Sort Method: quicksort Memory: 41881kB
18. 319.564 189,107.714 ↓ 5.4 254,125 1

Hash Join (cost=479,014.57..1,514,079.59 rows=46,859 width=94) (actual time=88,681.153..189,107.714 rows=254,125 loops=1)

  • Hash Cond: (public.games.w_user = u1.id_user)
19. 506.938 188,644.349 ↓ 5.4 254,125 1

Hash Join (cost=474,284.42..1,508,470.83 rows=46,859 width=73) (actual time=88,537.238..188,644.349 rows=254,125 loops=1)

  • Hash Cond: (public.games.b_user = u2.id_user)
20. 100,573.136 188,120.781 ↓ 22.3 2,091,568 1

Bitmap Heap Scan on games (cost=470,600.70..1,503,498.49 rows=93,718 width=52) (actual time=87,742.574..188,120.781 rows=2,091,568 loops=1)

  • Recheck Cond: ((total_time = 180::double precision) AND (increment = 0::double precision))
  • Filter: (stockfish_analysed AND stockfish_analysed AND (ply_count > 10))
21. 87,547.645 87,547.645 ↓ 1.2 19,861,183 1

Bitmap Index Scan on index_total_increment (cost=0.00..470,577.28 rows=16,807,988 width=0) (actual time=87,547.645..87,547.645 rows=19,861,183 loops=1)

  • Index Cond: ((total_time = 180::double precision) AND (increment = 0::double precision))
22. 0.036 16.630 ↑ 1,195.9 70 1

Hash (cost=2,637.29..2,637.29 rows=83,714 width=25) (actual time=16.630..16.630 rows=70 loops=1)

23. 16.594 16.594 ↑ 1,195.9 70 1

Seq Scan on users u2 (cost=0.00..2,637.29 rows=83,714 width=25) (actual time=15.505..16.594 rows=70 loops=1)

  • Filter: has_chronotype
24. 39.738 143.801 ↑ 1.0 167,255 1

Hash (cost=2,637.29..2,637.29 rows=167,429 width=25) (actual time=143.801..143.801 rows=167,255 loops=1)

25. 104.063 104.063 ↑ 1.0 167,255 1

Seq Scan on users u1 (cost=0.00..2,637.29 rows=167,429 width=25) (actual time=18.455..104.063 rows=167,255 loops=1)