explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5iaT

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 377.744 ↑ 1.0 1 1

Aggregate (cost=26,810.65..26,810.66 rows=1 width=8) (actual time=377.744..377.744 rows=1 loops=1)

2. 0.071 377.740 ↑ 3,755.0 1 1

HashAggregate (cost=26,726.16..26,763.71 rows=3,755 width=8) (actual time=377.719..377.740 rows=1 loops=1)

  • Group Key: sp_playlists.id, sp_playlists.followers_count
3. 0.002 377.669 ↑ 1,877.5 2 1

Append (cost=0.99..26,707.39 rows=3,755 width=8) (actual time=0.024..377.669 rows=2 loops=1)

4. 0.002 0.025 ↑ 5.0 1 1

Nested Loop (cost=0.99..58.66 rows=5 width=8) (actual time=0.024..0.025 rows=1 loops=1)

5. 0.002 0.018 ↑ 5.0 1 1

Nested Loop (cost=0.71..55.68 rows=5 width=4) (actual time=0.018..0.018 rows=1 loops=1)

6. 0.010 0.010 ↑ 5.0 1 1

Index Scan using index_sp_playlist_listings_on_sp_track_id on sp_playlist_listings (cost=0.42..14.18 rows=5 width=4) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (sp_track_id = 684,091)
7. 0.006 0.006 ↑ 1.0 1 1

Index Scan using sp_playlist_editions_pkey on sp_playlist_editions (cost=0.28..8.30 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id = sp_playlist_listings.sp_playlist_edition_id)
  • Filter: current
8. 0.005 0.005 ↑ 1.0 1 1

Index Scan using sp_playlists_pkey on sp_playlists (cost=0.29..0.60 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id = sp_playlist_editions.sp_playlist_id)
9. 0.077 377.642 ↑ 3,750.0 1 1

Hash Join (cost=6,516.83..26,611.18 rows=3,750 width=8) (actual time=331.106..377.642 rows=1 loops=1)

  • Hash Cond: (sp_playlist_editions_1.sp_playlist_id = sp_playlists_1.id)
10. 0.031 370.409 ↑ 3,750.0 1 1

Hash Join (cost=5,823.30..25,907.81 rows=3,750 width=4) (actual time=323.873..370.409 rows=1 loops=1)

  • Hash Cond: (sp_playlist_listings_1.sp_playlist_edition_id = sp_playlist_editions_1.id)
11. 216.726 365.345 ↑ 3,876.0 1 1

Hash Join (cost=5,594.35..25,668.67 rows=3,876 width=4) (actual time=318.810..365.345 rows=1 loops=1)

  • Hash Cond: (sp_playlist_listings_1.sp_track_id = s.id)
12. 148.529 148.529 ↑ 1.0 776,103 1

Seq Scan on sp_playlist_listings sp_playlist_listings_1 (cost=0.00..18,037.03 rows=776,103 width=8) (actual time=0.023..148.529 rows=776,103 loops=1)

13. 0.013 0.090 ↑ 2,014.0 1 1

Hash (cost=5,569.17..5,569.17 rows=2,014 width=4) (actual time=0.090..0.090 rows=1 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 17kB
14. 0.011 0.077 ↑ 2,014.0 1 1

Bitmap Heap Scan on sp_tracks s (cost=48.05..5,569.17 rows=2,014 width=4) (actual time=0.077..0.077 rows=1 loops=1)

  • Recheck Cond: ((upper(replace((isrc)::text, '-'::text, ''::text)))::citext = 'GBJXP1421202'::citext)
  • Filter: (isrc IS NOT NULL)
  • Heap Blocks: exact=1
15. 0.066 0.066 ↑ 2,016.0 1 1

Bitmap Index Scan on index_sp_tracks_on_sanitized_isrc (cost=0.00..47.54 rows=2,016 width=0) (actual time=0.066..0.066 rows=1 loops=1)

  • Index Cond: ((upper(replace((isrc)::text, '-'::text, ''::text)))::citext = 'GBJXP1421202'::citext)
16. 2.495 5.033 ↑ 1.0 6,829 1

Hash (cost=143.59..143.59 rows=6,829 width=8) (actual time=5.033..5.033 rows=6,829 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 331kB
17. 2.538 2.538 ↑ 1.0 6,829 1

Seq Scan on sp_playlist_editions sp_playlist_editions_1 (cost=0.00..143.59 rows=6,829 width=8) (actual time=0.031..2.538 rows=6,829 loops=1)

  • Filter: current
  • Rows Removed by Filter: 230
18. 2.726 7.156 ↑ 1.0 9,890 1

Hash (cost=569.90..569.90 rows=9,890 width=8) (actual time=7.156..7.156 rows=9,890 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 503kB
19. 4.430 4.430 ↑ 1.0 9,890 1

Seq Scan on sp_playlists sp_playlists_1 (cost=0.00..569.90 rows=9,890 width=8) (actual time=0.007..4.430 rows=9,890 loops=1)

Planning time : 2.994 ms
Execution time : 378.054 ms