explain.depesz.com

PostgreSQL's explain analyze made readable

Result: olRw

Settings
# exclusive inclusive rows x rows loops node
1. 554.465 86,525.706 ↓ 3.2 9,976 1

Subquery Scan on window_results (cost=1,696,059.65..1,696,484.32 rows=3,146 width=404) (actual time=78,920.084..86,525.706 rows=9,976 loops=1)

  • Filter: (window_results.row_number <= 1)
  • Rows Removed by Filter: 1554023
2. 3,492.581 85,971.241 ↓ 165.7 1,563,999 1

WindowAgg (cost=1,696,059.65..1,696,366.35 rows=9,437 width=412) (actual time=78,920.076..85,971.241 rows=1,563,999 loops=1)

3. 15,109.390 82,478.660 ↓ 165.7 1,563,999 1

Sort (cost=1,696,059.65..1,696,083.24 rows=9,437 width=384) (actual time=78,918.764..82,478.660 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,283.958 67,369.270 ↓ 165.7 1,563,999 1

Nested Loop Left Join (cost=1,001.57..1,695,436.62 rows=9,437 width=384) (actual time=77.908..67,369.270 rows=1,563,999 loops=1)

5. 3,116.810 60,957.314 ↓ 165.7 1,563,999 1

Gather (cost=1,001.30..1,692,557.86 rows=9,437 width=303) (actual time=77.896..60,957.314 rows=1,563,999 loops=1)

  • Workers Planned: 7
  • Workers Launched: 5
6. 2,329.391 57,840.504 ↓ 193.4 260,666 6

Nested Loop (cost=1.30..1,690,614.16 rows=1,348 width=303) (actual time=56.879..57,840.504 rows=260,666 loops=6)

7. 5,033.017 55,511.107 ↓ 193.4 260,666 6

Nested Loop (cost=1.01..1,690,184.26 rows=1,348 width=122) (actual time=56.864..55,511.107 rows=260,666 loops=6)

8. 49,090.008 50,478.073 ↓ 193.4 260,666 6

Nested Loop (cost=0.57..1,689,556.24 rows=1,348 width=117) (actual time=56.837..50,478.073 rows=260,666 loops=6)

9. 907.969 907.969 ↓ 3.7 103 6

Parallel Seq Scan on it_songs (cost=0.00..1,138,912.14 rows=28 width=101) (actual time=15.109..907.969 rows=103 loops=6)

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

Index Scan using index_am_playlist_listings_on_it_song_id on am_playlist_listings (cost=0.57..19,603.46 rows=6,240 width=20) (actual time=2.783..480.096 rows=2,539 loops=616)

  • Index Cond: (it_song_id = it_songs.id)
11. 0.017 0.017 ↑ 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.017..0.017 rows=1 loops=1,563,999)

  • Index Cond: (id = am_playlist_listings.am_playlist_edition_id)
12. 0.006 0.006 ↑ 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.006..0.006 rows=1 loops=1,563,999)

  • Index Cond: (id = am_playlist_editions.am_playlist_id)
13. 3,127.998 3,127.998 ↑ 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.002..0.002 rows=1 loops=1,563,999)

  • Index Cond: (id = am_playlists.am_curator_id)
Planning time : 2.869 ms
Execution time : 86,630.662 ms