explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Syqx

Settings
# exclusive inclusive rows x rows loops node
1. 645.102 147,036.489 ↑ 3.2 9,976 1

Subquery Scan on window_results (cost=3,156,983.30..3,161,274.05 rows=31,783 width=404) (actual time=137,611.721..147,036.489 rows=9,976 loops=1)

  • Filter: (window_results.row_number <= 1)
  • Rows Removed by Filter: 1554023
2. 4,206.929 146,391.387 ↓ 16.4 1,563,999 1

WindowAgg (cost=3,156,983.30..3,160,082.18 rows=95,350 width=412) (actual time=137,611.713..146,391.387 rows=1,563,999 loops=1)

3. 18,772.744 142,184.458 ↓ 16.4 1,563,999 1

Sort (cost=3,156,983.30..3,157,221.68 rows=95,350 width=384) (actual time=137,610.480..142,184.458 rows=1,563,999 loops=1)

  • Sort Key: it_songs.name, am_playlists.id, am_playlist_listings.created_at DESC
  • Sort Method: external merge Disk: 486096kB
4. 3,387.727 123,411.714 ↓ 16.4 1,563,999 1

Nested Loop Left Join (cost=1,001.57..3,132,475.91 rows=95,350 width=384) (actual time=20.879..123,411.714 rows=1,563,999 loops=1)

5. 1,605.699 115,331.990 ↓ 16.4 1,563,999 1

Gather (cost=1,001.30..3,103,389.42 rows=95,350 width=303) (actual time=20.847..115,331.990 rows=1,563,999 loops=1)

  • Workers Planned: 7
  • Workers Launched: 0
6. 16,165.380 113,726.291 ↓ 114.8 1,563,999 1

Nested Loop (cost=1.30..3,092,854.42 rows=13,621 width=303) (actual time=19.996..113,726.291 rows=1,563,999 loops=1)

7. 25,908.705 97,560.903 ↓ 114.8 1,563,999 1

Nested Loop (cost=1.01..3,088,510.39 rows=13,621 width=122) (actual time=19.922..97,560.903 rows=1,563,999 loops=1)

8. 63,377.023 71,652.184 ↓ 114.8 1,563,999 1

Nested Loop (cost=0.57..3,082,164.52 rows=13,621 width=117) (actual time=19.898..71,652.184 rows=1,563,999 loops=1)

9. 8,175.165 8,175.165 ↓ 1.5 616 1

Parallel Seq Scan on it_songs (cost=0.00..1,144,958.10 rows=401 width=101) (actual time=0.012..8,175.165 rows=616 loops=1)

  • Filter: (it_account_id = 1)
  • Rows Removed by Filter: 8440693
10. 99.996 99.996 ↑ 2.5 2,539 616

Index Scan using index_am_playlist_listings_on_it_song_id on am_playlist_listings (cost=0.57..4,768.54 rows=6,240 width=20) (actual time=0.122..99.996 rows=2,539 loops=616)

  • Index Cond: (it_song_id = it_songs.id)
11. 0.014 0.014 ↑ 1.0 1 1,563,999

Index Scan using am_playlist_editions_pkey on am_playlist_editions (cost=0.43..0.46 rows=1 width=13) (actual time=0.014..0.014 rows=1 loops=1,563,999)

  • Index Cond: (id = am_playlist_listings.am_playlist_edition_id)
12. 0.008 0.008 ↑ 1.0 1 1,563,999

Index Scan using am_playlists_pkey on am_playlists (cost=0.29..0.31 rows=1 width=185) (actual time=0.007..0.008 rows=1 loops=1,563,999)

  • Index Cond: (id = am_playlist_editions.am_playlist_id)
13. 4,691.997 4,691.997 ↑ 1.0 1 1,563,999

Index Scan using am_curators_pkey on am_curators (cost=0.28..0.30 rows=1 width=89) (actual time=0.003..0.003 rows=1 loops=1,563,999)

  • Index Cond: (id = am_playlists.am_curator_id)
Planning time : 6.543 ms
Execution time : 147,146.057 ms