explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qj2Cu

Settings
# exclusive inclusive rows x rows loops node
1. 1,178.447 5,992.404 ↑ 1.1 918 1

HashAggregate (cost=15,519.96..15,529.83 rows=987 width=4) (actual time=5,992.272..5,992.404 rows=918 loops=1)

  • Group Key: sp_accounts.id
2. 1,094.226 4,813.957 ↓ 282.7 10,479,186 1

Nested Loop (cost=21.89..15,427.28 rows=37,072 width=4) (actual time=0.418..4,813.957 rows=10,479,186 loops=1)

  • Join Filter: (sp_accounts.id = sp_account_tracks.sp_account_id)
3. 7.285 24.571 ↓ 9.6 30,793 1

Hash Left Join (cost=21.33..3,548.01 rows=3,198 width=8) (actual time=0.399..24.571 rows=30,793 loops=1)

  • Hash Cond: (sp_account_albums.sp_album_id = sp_albums.id)
  • Filter: ((sp_accounts.followers_count >= 200) OR (sp_albums.id IS NOT NULL))
  • Rows Removed by Filter: 509
4. 3.829 16.908 ↓ 9.8 31,302 1

Nested Loop (cost=0.86..3,519.16 rows=3,198 width=16) (actual time=0.015..16.908 rows=31,302 loops=1)

5. 5.087 5.087 ↓ 1.0 999 1

Index Scan using sp_accounts_pkey on sp_accounts (cost=0.43..1,038.55 rows=987 width=8) (actual time=0.005..5.087 rows=999 loops=1)

  • Index Cond: (id < 1000)
6. 7.992 7.992 ↑ 1.2 31 999

Index Only Scan using index_sp_account_albums_on_sp_account_id_and_sp_album_id on sp_account_albums (cost=0.43..2.13 rows=38 width=8) (actual time=0.003..0.008 rows=31 loops=999)

  • Index Cond: (sp_account_id = sp_accounts.id)
  • Heap Fetches: 23
7. 0.040 0.378 ↑ 1.0 199 1

Hash (cost=17.95..17.95 rows=201 width=4) (actual time=0.378..0.378 rows=199 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
8. 0.338 0.338 ↑ 1.0 199 1

Index Only Scan using sp_albums_pkey on sp_albums (cost=0.43..17.95 rows=201 width=4) (actual time=0.006..0.338 rows=199 loops=1)

  • Index Cond: (id < 200)
  • Heap Fetches: 140
9. 3,695.160 3,695.160 ↓ 3.3 340 30,793

Index Scan using index_sp_account_tracks_on_sp_account_id on sp_account_tracks (cost=0.56..2.43 rows=103 width=4) (actual time=0.003..0.120 rows=340 loops=30,793)

  • Index Cond: (sp_account_id = sp_account_albums.sp_account_id)
  • Filter: (NOT inactive)
  • Rows Removed by Filter: 1
Planning time : 0.972 ms
Execution time : 5,992.504 ms