explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FaYv

Settings
# exclusive inclusive rows x rows loops node
1. 10.078 6,554.902 ↑ 1.1 1,001 1

Nested Loop Left Join (cost=24.22..62,723.84 rows=1,058 width=363) (actual time=32.401..6,554.902 rows=1,001 loops=1)

2. 3.834 6,358.638 ↑ 1.1 1,001 1

Nested Loop Left Join (cost=23.80..43,937.02 rows=1,058 width=597) (actual time=31.420..6,358.638 rows=1,001 loops=1)

3. 4.081 6,344.794 ↑ 1.1 1,001 1

Nested Loop Left Join (cost=23.37..43,199.86 rows=1,058 width=479) (actual time=31.410..6,344.794 rows=1,001 loops=1)

  • Join Filter: (it_accounts.id = it_collections.it_account_id)
  • Rows Removed by Join Filter: 137
4. 4.010 5,999.372 ↑ 1.1 1,001 1

Nested Loop Left Join (cost=22.94..42,614.92 rows=1,058 width=333) (actual time=31.071..5,999.372 rows=1,001 loops=1)

5. 5,292.531 5,951.318 ↑ 1.1 1,001 1

Nested Loop Left Join (cost=22.52..42,124.97 rows=1,058 width=329) (actual time=31.057..5,951.318 rows=1,001 loops=1)

6. 200.045 611.740 ↑ 1.1 1,001 1

Nested Loop Left Join (cost=13.49..24,098.13 rows=1,058 width=209) (actual time=29.817..611.740 rows=1,001 loops=1)

7. 1.641 43.327 ↑ 1.1 1,001 1

Nested Loop (cost=0.57..1,976.67 rows=1,058 width=78) (actual time=29.751..43.327 rows=1,001 loops=1)

8. 0.005 0.015 ↑ 1.0 1 1

Nested Loop (cost=0.14..9.18 rows=1 width=8) (actual time=0.010..0.015 rows=1 loops=1)

  • Join Filter: (occ_chart_editions.occ_chart_source_id = occ_chart_sources.id)
9. 0.006 0.006 ↑ 1.0 1 1

Index Scan using occ_chart_editions_pkey on occ_chart_editions (cost=0.14..8.16 rows=1 width=16) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: (id = 100)
10. 0.004 0.004 ↑ 1.0 1 1

Seq Scan on occ_chart_sources (cost=0.00..1.01 rows=1 width=8) (actual time=0.002..0.004 rows=1 loops=1)

11. 41.671 41.671 ↑ 1.1 1,001 1

Index Scan using index_occ_chart_listings_on_edition_id_and_position on occ_chart_listings (cost=0.43..1,956.91 rows=1,058 width=78) (actual time=29.737..41.671 rows=1,001 loops=1)

  • Index Cond: ((occ_chart_edition_id = 100) AND ("position" >= 2000) AND ("position" <= 3000))
12. 174.174 368.368 ↑ 1.0 1 1,001

Index Scan using it_songs_pkey on it_songs (cost=12.91..20.90 rows=1 width=131) (actual time=0.365..0.368 rows=1 loops=1,001)

  • Index Cond: (id = (SubPlan 3))
13.          

SubPlan (for Index Scan)

14. 3.003 194.194 ↑ 1.0 1 1,001

Limit (cost=12.47..12.48 rows=1 width=4) (actual time=0.193..0.194 rows=1 loops=1,001)

15. 9.009 191.191 ↑ 2.0 1 1,001

Sort (cost=12.47..12.48 rows=2 width=4) (actual time=0.191..0.191 rows=1 loops=1,001)

  • Sort Key: it_songs_1.id DESC
  • Sort Method: quicksort Memory: 25kB
16. 182.182 182.182 ↓ 3.0 6 1,001

Index Scan using index_it_songs_on_isrc on it_songs it_songs_1 (cost=0.43..12.46 rows=2 width=4) (actual time=0.164..0.182 rows=6 loops=1,001)

  • Index Cond: ((isrc)::text = (occ_chart_listings.primary_isrc)::text)
17. 0.000 47.047 ↑ 1.0 1 1,001

Index Scan using sp_tracks_pkey on sp_tracks (cost=9.03..17.03 rows=1 width=120) (actual time=0.046..0.047 rows=1 loops=1,001)

  • Index Cond: (id = (SubPlan 4))
18.          

SubPlan (for Index Scan)

19. 3.003 5,285.280 ↑ 1.0 1 1,001

Limit (cost=8.59..8.60 rows=1 width=8) (actual time=5.279..5.280 rows=1 loops=1,001)

20. 12.012 5,282.277 ↑ 1.0 1 1,001

Sort (cost=8.59..8.60 rows=1 width=8) (actual time=5.277..5.277 rows=1 loops=1,001)

  • Sort Key: sp_tracks_1.popularity DESC
  • Sort Method: quicksort Memory: 25kB
21. 5,270.265 5,270.265 ↓ 6.0 6 1,001

Index Scan using index_sp_tracks_on_isrc on sp_tracks sp_tracks_1 (cost=0.56..8.58 rows=1 width=8) (actual time=0.806..5.265 rows=6 loops=1,001)

  • Index Cond: ((isrc IS NOT NULL) AND ((isrc)::text = (occ_chart_listings.primary_isrc)::text))
22. 44.044 44.044 ↑ 1.0 1 1,001

Index Scan using it_accounts_pkey on it_accounts (cost=0.42..0.45 rows=1 width=8) (actual time=0.044..0.044 rows=1 loops=1,001)

  • Index Cond: (it_songs.it_account_id = id)
23. 341.341 341.341 ↑ 1.0 1 1,001

Index Scan using it_collections_pkey on it_collections (cost=0.43..0.54 rows=1 width=158) (actual time=0.335..0.341 rows=1 loops=1,001)

  • Index Cond: (id = it_songs.it_collection_id)
24. 10.010 10.010 ↑ 1.0 1 1,001

Index Scan using artists_pkey on artists (cost=0.42..0.69 rows=1 width=122) (actual time=0.010..0.010 rows=1 loops=1,001)

  • Index Cond: (id = it_accounts.artist_id)
25. 31.031 31.031 ↑ 1.0 1 1,001

Index Scan using index_sp_accounts_on_artist_id on sp_accounts (cost=0.43..0.84 rows=1 width=73) (actual time=0.030..0.031 rows=1 loops=1,001)

  • Index Cond: (artist_id = artists.id)
26.          

SubPlan (for Nested Loop Left Join)

27. 2.002 142.142 ↑ 1.0 1 1,001

Limit (cost=0.43..8.45 rows=1 width=4) (actual time=0.142..0.142 rows=1 loops=1,001)

28. 140.140 140.140 ↑ 1.0 1 1,001

Index Scan using index_occ_chart_listings_on_edition_id_and_isrc on occ_chart_listings ocl (cost=0.43..8.45 rows=1 width=4) (actual time=0.140..0.140 rows=1 loops=1,001)

  • Index Cond: ((occ_chart_edition_id = 99) AND ((primary_isrc)::text = (occ_chart_listings.primary_isrc)::text))
29. 2.002 13.013 ↑ 1.0 1 1,001

Limit (cost=0.43..8.45 rows=1 width=4) (actual time=0.013..0.013 rows=1 loops=1,001)

30. 11.011 11.011 ↑ 1.0 1 1,001

Index Scan using index_occ_chart_listings_on_edition_id_and_isrc on occ_chart_listings ocl_1 (cost=0.43..8.45 rows=1 width=4) (actual time=0.011..0.011 rows=1 loops=1,001)

  • Index Cond: ((occ_chart_edition_id = 99) AND ((primary_isrc)::text = (occ_chart_listings.primary_isrc)::text))
Planning time : 1.715 ms
Execution time : 6,555.537 ms