explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nxsf

Settings
# exclusive inclusive rows x rows loops node
1. 1.740 137.538 ↑ 2.1 117 1

Subquery Scan on window_results (cost=1,028,998.27..1,029,032.85 rows=243 width=152) (actual time=117.145..137.538 rows=117 loops=1)

  • Filter: (window_results.row_number <= 1)
  • Rows Removed by Filter: 5009
2. 16.525 135.798 ↓ 7.0 5,126 1

WindowAgg (cost=1,028,998.27..1,029,023.75 rows=728 width=160) (actual time=117.138..135.798 rows=5,126 loops=1)

3. 14.409 119.273 ↓ 7.0 5,126 1

Sort (cost=1,028,998.27..1,029,000.09 rows=728 width=132) (actual time=117.119..119.273 rows=5,126 loops=1)

  • Sort Key: sc_chart_listings.genre, sc_chart_listings.chart_type, sc_chart_listings.country, sc_songs.id, sc_chart_listings.created_at DESC
  • Sort Method: quicksort Memory: 1246kB
4. 4.008 104.864 ↓ 7.0 5,126 1

Nested Loop (cost=21.25..1,028,963.66 rows=728 width=132) (actual time=3.806..104.864 rows=5,126 loops=1)

5. 0.700 0.700 ↑ 7.4 73 1

Index Scan using index_sc_songs_on_sc_account_id on sc_songs (cost=0.56..2,156.27 rows=538 width=100) (actual time=0.029..0.700 rows=73 loops=1)

  • Index Cond: (sc_account_id = 7675)
6. 27.302 100.156 ↑ 7.6 70 73

Bitmap Heap Scan on sc_chart_listings (cost=20.69..1,903.21 rows=535 width=36) (actual time=1.011..1.372 rows=70 loops=73)

  • Recheck Cond: (sc_song_id = sc_songs.id)
  • Filter: (created_at >= '2017-09-25 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=4921
7. 72.854 72.854 ↑ 7.7 70 73

Bitmap Index Scan on index_sc_chart_listings_on_sc_song_id (cost=0.00..20.56 rows=537 width=0) (actual time=0.998..0.998 rows=70 loops=73)

  • Index Cond: (sc_song_id = sc_songs.id)
Planning time : 172.783 ms
Execution time : 137.813 ms