explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wHXJ

Settings
# exclusive inclusive rows x rows loops node
1. 3.388 123,128.241 ↓ 7.2 209 1

Subquery Scan on window_results (cost=1,020,263.04..1,020,267.13 rows=29 width=150) (actual time=123,074.889..123,128.241 rows=209 loops=1)

  • Filter: (window_results.row_number <= 1)
  • Rows Removed by Filter: 38,249
2. 40.392 123,124.853 ↓ 447.2 38,458 1

WindowAgg (cost=1,020,263.04..1,020,266.05 rows=86 width=194) (actual time=123,074.611..123,124.853 rows=38,458 loops=1)

3. 313.312 123,084.461 ↓ 447.2 38,458 1

Sort (cost=1,020,263.04..1,020,263.26 rows=86 width=182) (actual time=123,074.581..123,084.461 rows=38,458 loops=1)

  • Sort Key: (COALESCE(it_songs.isrc, (it_songs.id)::character varying(255))), am_playlists.name, am_playlist_listings."position", am_playlist_listings.created_at
  • Sort Method: external sort Disk: 7,152kB
4. 40.339 122,771.149 ↓ 447.2 38,458 1

WindowAgg (cost=1,020,257.27..1,020,260.28 rows=86 width=182) (actual time=122,720.766..122,771.149 rows=38,458 loops=1)

5. 396.595 122,730.810 ↓ 447.2 38,458 1

Sort (cost=1,020,257.27..1,020,257.49 rows=86 width=162) (actual time=122,720.643..122,730.810 rows=38,458 loops=1)

  • Sort Key: (COALESCE(it_songs.isrc, (it_songs.id)::character varying(255))), am_playlists.name, am_playlist_listings.created_at DESC
  • Sort Method: external merge Disk: 6,256kB
6. 20.407 122,334.215 ↓ 447.2 38,458 1

Gather (cost=1,001.99..1,020,254.51 rows=86 width=162) (actual time=377.111..122,334.215 rows=38,458 loops=1)

  • Workers Planned: 6
  • Workers Launched: 0
7. 51.850 122,313.808 ↓ 2,747.0 38,458 1

Nested Loop (cost=1.98..1,019,245.37 rows=14 width=162) (actual time=376.015..122,313.808 rows=38,458 loops=1)

8. 180.823 122,146.584 ↓ 2,747.0 38,458 1

Nested Loop (cost=1.55..1,019,210.96 rows=14 width=126) (actual time=375.989..122,146.584 rows=38,458 loops=1)

9. 246.741 120,799.857 ↓ 176.4 291,476 1

Nested Loop (cost=1.14..1,018,489.66 rows=1,652 width=65) (actual time=375.963..120,799.857 rows=291,476 loops=1)

10. 117.076 108,894.076 ↓ 176.4 291,476 1

Nested Loop (cost=0.57..1,017,526.39 rows=1,652 width=65) (actual time=375.946..108,894.076 rows=291,476 loops=1)

11. 4,288.154 4,288.154 ↓ 5.9 154 1

Parallel Seq Scan on it_songs (cost=0.00..751,946.01 rows=26 width=45) (actual time=152.871..4,288.154 rows=154 loops=1)

  • Filter: (it_account_id = 5,648)
  • Rows Removed by Filter: 14,292,941
12. 104,488.846 104,488.846 ↑ 6.5 1,893 154

Index Scan using index_am_playlist_listings_on_it_song_id on am_playlist_listings (cost=0.57..10,092.05 rows=12,258 width=24) (actual time=0.919..678.499 rows=1,893 loops=154)

  • Index Cond: (it_song_id = it_songs.id)
13. 11,659.040 11,659.040 ↑ 1.0 1 291,476

Index Scan using am_playlist_editions_pkey on am_playlist_editions (cost=0.56..0.58 rows=1 width=8) (actual time=0.040..0.040 rows=1 loops=291,476)

  • Index Cond: (id = am_playlist_listings.am_playlist_edition_id)
14. 1,165.904 1,165.904 ↓ 0.0 0 291,476

Index Scan using am_playlists_pkey on am_playlists (cost=0.41..0.44 rows=1 width=65) (actual time=0.004..0.004 rows=0 loops=291,476)

  • Index Cond: (id = am_playlist_editions.am_playlist_id)
  • Filter: ((name)::text ~~ 'Top 100: %'::text)
  • Rows Removed by Filter: 1
15. 115.374 115.374 ↑ 1.0 1 38,458

Index Scan using it_collections_pkey on it_collections (cost=0.43..2.45 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=38,458)

  • Index Cond: (id = it_songs.it_collection_id)
Planning time : 2.776 ms
Execution time : 123,132.623 ms