explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mktn

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.069 ↓ 0.0 0 1

Nested Loop Left Join (cost=89.25..65,259.04 rows=709 width=647) (actual time=0.069..0.069 rows=0 loops=1)

2. 0.000 0.067 ↓ 0.0 0 1

Nested Loop Left Join (cost=88.83..3,662.54 rows=709 width=578) (actual time=0.067..0.067 rows=0 loops=1)

3. 0.000 0.067 ↓ 0.0 0 1

Nested Loop Left Join (cost=88.54..3,428.93 rows=709 width=562) (actual time=0.067..0.067 rows=0 loops=1)

4. 0.001 0.067 ↓ 0.0 0 1

Hash Left Join (cost=88.25..3,145.97 rows=709 width=388) (actual time=0.067..0.067 rows=0 loops=1)

  • Hash Cond: (shazam_tracks.id = shazam_track_growth_metrics.shazam_track_id)
5. 0.000 0.066 ↓ 0.0 0 1

Nested Loop (cost=45.54..3,101.40 rows=709 width=314) (actual time=0.066..0.066 rows=0 loops=1)

6. 0.066 0.066 ↓ 0.0 0 1

Index Only Scan using shazam_chart_sources_pkey on shazam_chart_sources (cost=0.28..8.29 rows=1 width=8) (actual time=0.066..0.066 rows=0 loops=1)

  • Index Cond: (id = 1)
  • Heap Fetches: 0
7. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=45.27..3,086.02 rows=709 width=314) (never executed)

8. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=44.85..145.90 rows=709 width=76) (never executed)

  • Hash Cond: (shazam_tracks.id = shazam_chart_listings.shazam_track_id)
9. 0.000 0.000 ↓ 0.0 0

Seq Scan on shazam_tracks (cost=0.00..77.82 rows=2,582 width=59) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Hash (cost=35.99..35.99 rows=709 width=25) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..35.99 rows=709 width=25) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Seq Scan on shazam_chart_editions (cost=0.00..1.07 rows=1 width=21) (never executed)

  • Filter: (current AND (shazam_chart_source_id = 1))
13. 0.000 0.000 ↓ 0.0 0

Index Scan using index_shazam_chart_listings_on_shazam_chart_edition_id on shazam_chart_listings (cost=0.28..29.59 rows=532 width=20) (never executed)

  • Index Cond: (shazam_chart_edition_id = shazam_chart_editions.id)
14. 0.000 0.000 ↓ 0.0 0

Index Scan using it_songs_pkey on it_songs (cost=0.42..4.15 rows=1 width=246) (never executed)

  • Index Cond: (id = shazam_tracks.it_song_id)
15. 0.000 0.000 ↓ 0.0 0

Hash (cost=28.98..28.98 rows=1,098 width=82) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Seq Scan on shazam_track_growth_metrics (cost=0.00..28.98 rows=1,098 width=82) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Index Scan using it_collections_pkey on it_collections (cost=0.29..0.40 rows=1 width=182) (never executed)

  • Index Cond: (id = it_songs.it_collection_id)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using it_accounts_pkey on it_accounts (cost=0.29..0.33 rows=1 width=20) (never executed)

  • Index Cond: (id = it_songs.it_account_id)
19. 0.000 0.000 ↓ 0.0 0

Index Scan using artists_pkey on artists (cost=0.42..1.26 rows=1 width=28) (never executed)

  • Index Cond: (id = it_accounts.artist_id)
20.          

SubPlan (for Nested Loop Left Join)

21. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.08..12.09 rows=1 width=8) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..12.08 rows=1 width=8) (never executed)

  • Join Filter: (shazam_chart_listings_1.shazam_chart_edition_id = shazam_chart_editions_1.id)
23. 0.000 0.000 ↓ 0.0 0

Seq Scan on shazam_chart_editions shazam_chart_editions_1 (cost=0.00..1.07 rows=1 width=8) (never executed)

  • Filter: (shazam_chart_source_id = 1)
24. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on shazam_chart_listings shazam_chart_listings_1 (cost=4.30..10.98 rows=2 width=16) (never executed)

  • Recheck Cond: (shazam_track_id = shazam_tracks.id)
25. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_shazam_chart_listings_on_shazam_track_id (cost=0.00..4.30 rows=2 width=0) (never executed)

  • Index Cond: (shazam_track_id = shazam_tracks.id)
26. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.08..12.09 rows=1 width=4) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..12.08 rows=1 width=4) (never executed)

  • Join Filter: (shazam_chart_listings_2.shazam_chart_edition_id = shazam_chart_editions_2.id)
28. 0.000 0.000 ↓ 0.0 0

Seq Scan on shazam_chart_editions shazam_chart_editions_2 (cost=0.00..1.07 rows=1 width=8) (never executed)

  • Filter: (shazam_chart_source_id = 1)
29. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on shazam_chart_listings shazam_chart_listings_2 (cost=4.30..10.98 rows=2 width=12) (never executed)

  • Recheck Cond: (shazam_track_id = shazam_tracks.id)
30. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_shazam_chart_listings_on_shazam_track_id (cost=0.00..4.30 rows=2 width=0) (never executed)

  • Index Cond: (shazam_track_id = shazam_tracks.id)
31. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=20.44..20.45 rows=1 width=8) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..20.44 rows=1 width=0) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..12.14 rows=1 width=8) (never executed)

  • Join Filter: (shazam_chart_editions_3.id = shazam_chart_listings_3.shazam_chart_edition_id)
34. 0.000 0.000 ↓ 0.0 0

Seq Scan on shazam_chart_editions shazam_chart_editions_3 (cost=0.00..1.06 rows=3 width=16) (never executed)

  • Filter: current
35. 0.000 0.000 ↓ 0.0 0

Materialize (cost=4.30..10.99 rows=2 width=8) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on shazam_chart_listings shazam_chart_listings_3 (cost=4.30..10.98 rows=2 width=8) (never executed)

  • Recheck Cond: (shazam_track_id = shazam_tracks.id)
37. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_shazam_chart_listings_on_shazam_track_id (cost=0.00..4.30 rows=2 width=0) (never executed)

  • Index Cond: (shazam_track_id = shazam_tracks.id)
38. 0.000 0.000 ↓ 0.0 0

Index Only Scan using shazam_chart_sources_pkey on shazam_chart_sources shazam_chart_sources_1 (cost=0.28..8.29 rows=1 width=8) (never executed)

  • Index Cond: (id = shazam_chart_editions_3.shazam_chart_source_id)
  • Heap Fetches: 0
39. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=20.44..20.45 rows=1 width=8) (never executed)

40. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..20.44 rows=1 width=0) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..12.14 rows=1 width=8) (never executed)

  • Join Filter: (shazam_chart_editions_4.id = shazam_chart_listings_4.shazam_chart_edition_id)
42. 0.000 0.000 ↓ 0.0 0

Seq Scan on shazam_chart_editions shazam_chart_editions_4 (cost=0.00..1.06 rows=3 width=16) (never executed)

  • Filter: current
43. 0.000 0.000 ↓ 0.0 0

Materialize (cost=4.30..10.99 rows=2 width=8) (never executed)

44. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on shazam_chart_listings shazam_chart_listings_4 (cost=4.30..10.98 rows=2 width=8) (never executed)

  • Recheck Cond: (shazam_track_id = shazam_tracks.id)
45. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_shazam_chart_listings_on_shazam_track_id (cost=0.00..4.30 rows=2 width=0) (never executed)

  • Index Cond: (shazam_track_id = shazam_tracks.id)
46. 0.000 0.000 ↓ 0.0 0

Index Scan using shazam_chart_sources_pkey on shazam_chart_sources shazam_chart_sources_2 (cost=0.28..8.29 rows=1 width=8) (never executed)

  • Index Cond: (id = shazam_chart_editions_4.shazam_chart_source_id)
  • Filter: ((shazam_chart_city_id IS NOT NULL) AND (shazam_chart_country_id IS NOT NULL))
47. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=20.49..20.50 rows=1 width=8) (never executed)

48. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..20.49 rows=1 width=0) (never executed)

49. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..12.14 rows=1 width=8) (never executed)

  • Join Filter: (shazam_chart_editions_5.id = shazam_chart_listings_5.shazam_chart_edition_id)
50. 0.000 0.000 ↓ 0.0 0

Seq Scan on shazam_chart_editions shazam_chart_editions_5 (cost=0.00..1.06 rows=3 width=16) (never executed)

  • Filter: current
51. 0.000 0.000 ↓ 0.0 0

Materialize (cost=4.30..10.99 rows=2 width=8) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on shazam_chart_listings shazam_chart_listings_5 (cost=4.30..10.98 rows=2 width=8) (never executed)

  • Recheck Cond: (shazam_track_id = shazam_tracks.id)
53. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_shazam_chart_listings_on_shazam_track_id (cost=0.00..4.30 rows=2 width=0) (never executed)

  • Index Cond: (shazam_track_id = shazam_tracks.id)
54. 0.000 0.000 ↓ 0.0 0

Index Scan using shazam_chart_sources_pkey on shazam_chart_sources shazam_chart_sources_3 (cost=0.28..8.29 rows=1 width=8) (never executed)

  • Index Cond: (id = shazam_chart_editions_5.shazam_chart_source_id)
  • Filter: ((shazam_chart_city_id IS NULL) AND (shazam_chart_country_id IS NOT NULL))
Planning time : 13.945 ms
Execution time : 0.857 ms