explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ht6P

Settings
# exclusive inclusive rows x rows loops node
1. 2.304 42,425.433 ↑ 1.8 47 1

Unique (cost=1,020,254.91..1,020,255.34 rows=86 width=103) (actual time=42,420.161..42,425.433 rows=47 loops=1)

2. 12.250 42,423.129 ↓ 447.2 38,458 1

Sort (cost=1,020,254.91..1,020,255.12 rows=86 width=103) (actual time=42,420.161..42,423.129 rows=38,458 loops=1)

  • Sort Key: it_songs.id
  • Sort Method: quicksort Memory: 6,635kB
3. 20.241 42,410.879 ↓ 447.2 38,458 1

WindowAgg (cost=1,020,249.13..1,020,252.14 rows=86 width=103) (actual time=42,386.861..42,410.879 rows=38,458 loops=1)

4. 70.661 42,390.638 ↓ 447.2 38,458 1

Sort (cost=1,020,249.13..1,020,249.35 rows=86 width=91) (actual time=42,386.852..42,390.638 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: quicksort Memory: 6,635kB
5. 19.971 42,319.977 ↓ 447.2 38,458 1

WindowAgg (cost=1,020,243.36..1,020,246.37 rows=86 width=91) (actual time=42,296.000..42,319.977 rows=38,458 loops=1)

6. 106.647 42,300.006 ↓ 447.2 38,458 1

Sort (cost=1,020,243.36..1,020,243.57 rows=86 width=71) (actual time=42,295.956..42,300.006 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: quicksort Memory: 4,927kB
7. 22,014.870 42,193.359 ↓ 447.2 38,458 1

Gather (cost=1,001.99..1,020,240.60 rows=86 width=71) (actual time=115.907..42,193.359 rows=38,458 loops=1)

  • Workers Planned: 6
  • Workers Launched: 3
8. 12.821 20,178.489 ↓ 686.7 9,614 4 / 4

Nested Loop (cost=1.98..1,019,231.46 rows=14 width=71) (actual time=234.555..20,178.489 rows=9,614 loops=4)

9. 53.965 20,146.439 ↓ 686.7 9,614 4 / 4

Nested Loop (cost=1.55..1,019,210.96 rows=14 width=56) (actual time=234.519..20,146.439 rows=9,614 loops=4)

10. 29.972 19,873.867 ↓ 44.1 72,869 4 / 4

Nested Loop (cost=1.14..1,018,489.66 rows=1,652 width=37) (actual time=97.301..19,873.867 rows=72,869 loops=4)

11. 22.146 18,313.646 ↓ 44.1 72,869 4 / 4

Nested Loop (cost=0.57..1,017,526.39 rows=1,652 width=37) (actual time=97.060..18,313.646 rows=72,869 loops=4)

12. 1,112.608 1,112.608 ↓ 1.5 38 4 / 4

Parallel Seq Scan on it_songs (cost=0.00..751,946.01 rows=26 width=21) (actual time=79.747..1,112.608 rows=38 loops=4)

  • Filter: (it_account_id = 5,648)
  • Rows Removed by Filter: 3,573,335
13. 17,178.892 17,178.892 ↑ 6.5 1,893 154 / 4

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=20) (actual time=0.748..446.205 rows=1,893 loops=154)

  • Index Cond: (it_song_id = it_songs.id)
14. 1,530.249 1,530.249 ↑ 1.0 1 291,476 / 4

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

  • Index Cond: (id = am_playlist_listings.am_playlist_edition_id)
15. 218.607 218.607 ↓ 0.0 0 291,476 / 4

Index Scan using am_playlists_pkey on am_playlists (cost=0.41..0.44 rows=1 width=27) (actual time=0.003..0.003 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
16. 19.229 19.229 ↑ 1.0 1 38,458 / 4

Index Only Scan using it_collections_pkey on it_collections (cost=0.43..1.46 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=38,458)

  • Index Cond: (id = it_songs.it_collection_id)
  • Heap Fetches: 16,375
Planning time : 1.037 ms