explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TGYi

Settings
# exclusive inclusive rows x rows loops node
1. 21.393 1,089.458 ↑ 1.0 20 1

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

2. 6.941 1,068.065 ↑ 9,016.9 20 1

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

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

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

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

Nested Loop (cost=173,152.13..331,653.91 rows=180,337 width=44) (actual time=697.457..1,021.387 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. 24.450 1,038.528 ↑ 6.2 29,308 1

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

  • Workers Planned: 4
  • Workers Launched: 4
7. 151.486 1,014.078 ↑ 7.7 5,862 5

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

  • Hash Cond: (youtube_video_to_game_2.youtube_video_id = videos_y2019_q3.id)
8. 203.050 349.583 ↑ 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=175.179..349.583 rows=441,440 loops=5)

  • Recheck Cond: (game_id = 24086)
  • Heap Blocks: exact=25332
9. 146.533 146.533 ↓ 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=146.533..146.533 rows=2,207,201 loops=1)

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

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

  • Buckets: 2097152 Batches: 1 Memory Usage: 134496kB
11. 27.168 364.993 ↑ 1.2 301,745 5

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

12. 337.821 337.821 ↑ 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.023..337.821 rows=301,745 loops=5)

  • Index Cond: ((published <= '2019-09-05'::date) AND (published >= '2019-08-06'::date))
  • Heap Fetches: 318114
13. 0.004 0.004 ↓ 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.004..0.004 rows=0 loops=1)

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