explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hvw5

Settings
# exclusive inclusive rows x rows loops node
1. 21.738 1,121.897 ↑ 1.0 20 1

Limit (cost=342,313.56..342,313.61 rows=20 width=140) (actual time=1,100.159..1,121.897 rows=20 loops=1)

2. 5.977 1,100.159 ↑ 9,016.9 20 1

Sort (cost=342,313.56..342,764.41 rows=180,337 width=140) (actual time=1,100.157..1,100.159 rows=20 loops=1)

  • Sort Key: (sum(videos_y2019_q3.view_count)) DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 27kB
3. 36.161 1,094.182 ↑ 6.2 29,308 1

HashAggregate (cost=333,908.12..337,514.86 rows=180,337 width=140) (actual time=1,072.745..1,094.182 rows=29,308 loops=1)

  • Group Key: videos_y2019_q3.id
4. 0.000 1,058.021 ↑ 6.2 29,308 1

Nested Loop (cost=173,152.13..331,653.91 rows=180,337 width=44) (actual time=726.530..1,058.021 rows=29,308 loops=1)

5. 0.014 0.014 ↑ 1.0 1 1

Index Only Scan using games_pkey on games (cost=0.29..1.41 rows=1 width=4) (actual time=0.011..0.014 rows=1 loops=1)

  • Index Cond: (id = 24086)
  • Heap Fetches: 0
6. 27.445 1,075.785 ↑ 6.2 29,308 1

Gather (cost=173,151.84..329,849.13 rows=180,337 width=48) (actual time=726.518..1,075.785 rows=29,308 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
7. 156.855 1,048.340 ↑ 7.7 5,862 5

Parallel Hash Join (cost=172,151.84..310,815.43 rows=45,084 width=48) (actual time=719.571..1,048.340 rows=5,862 loops=5)

  • Hash Cond: (youtube_video_to_game_2.youtube_video_id = videos_y2019_q3.id)
8. 206.366 367.274 ↑ 1.2 441,440 5

Parallel Bitmap Heap Scan on youtube_video_to_game_2 (cost=45,055.06..181,550.27 rows=548,177 width=16) (actual time=191.982..367.274 rows=441,440 loops=5)

  • Recheck Cond: (game_id = 24086)
  • Heap Blocks: exact=25417
9. 160.908 160.908 ↓ 1.0 2,207,201 1

Bitmap Index Scan on youtube_video_to_game_2_game_id_idx (cost=0.00..44,506.88 rows=2,192,709 width=0) (actual time=160.908..160.908 rows=2,207,201 loops=1)

  • Index Cond: (game_id = 24086)
10. 149.187 524.211 ↑ 1.2 301,745 5

Parallel Hash (cost=122,675.85..122,675.85 rows=353,675 width=44) (actual time=524.211..524.211 rows=301,745 loops=5)

  • Buckets: 2097152 Batches: 1 Memory Usage: 134528kB
11. 27.845 375.024 ↑ 1.2 301,745 5

Parallel Append (cost=0.12..122,675.85 rows=353,675 width=44) (actual time=0.034..375.024 rows=301,745 loops=5)

12. 347.174 347.174 ↑ 1.2 301,745 5

Parallel Index Only Scan using videos_y2019_q3_channel_id_published_id_view_count_comment__idx on videos_y2019_q3 (cost=0.56..120,906.23 rows=353,675 width=44) (actual time=0.031..347.174 rows=301,745 loops=5)

  • Index Cond: ((published <= '2019-09-05'::date) AND (published >= '2019-08-06'::date))
  • Heap Fetches: 318114
13. 0.005 0.005 ↓ 0.0 0 1

Parallel Index Only Scan using videos_default_channel_id_published_id_view_count_comment_c_idx on videos_default (cost=0.12..1.24 rows=1 width=44) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((published <= '2019-09-05'::date) AND (published >= '2019-08-06'::date))
  • Heap Fetches: 0
Planning time : 3.319 ms