explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VhQw

Settings
# exclusive inclusive rows x rows loops node
1. 0.135 3,249.772 ↑ 1.0 1 1

Aggregate (cost=399,757.50..399,757.51 rows=1 width=8) (actual time=3,249.772..3,249.772 rows=1 loops=1)

2. 0.037 3,249.637 ↓ 1.0 1,511 1

Nested Loop (cost=4,993.95..399,753.80 rows=1,483 width=0) (actual time=956.881..3,249.637 rows=1,511 loops=1)

  • Join Filter: (view_materialized_activities_all.donation_id = burn_to_give_donation.id)
3. 278.780 3,245.067 ↓ 1.0 1,511 1

Hash Join (cost=4,993.52..398,927.44 rows=1,484 width=12) (actual time=956.862..3,245.067 rows=1,511 loops=1)

  • Hash Cond: (t.donation_id = view_materialized_activities_all.donation_id)
4. 240.805 2,961.595 ↓ 1.0 3,302,002 1

Append (cost=7.70..348,998.43 rows=3,267,516 width=382) (actual time=0.061..2,961.595 rows=3,302,002 loops=1)

5. 298.514 1,343.627 ↓ 1.0 1,451,852 1

Hash Join (cost=7.70..215,062.27 rows=1,423,325 width=252) (actual time=0.061..1,343.627 rows=1,451,852 loops=1)

  • Hash Cond: (t.sport_id = s.id)
6. 1,045.070 1,045.070 ↓ 1.0 1,451,852 1

Seq Scan on burn_to_give_training t (cost=0.00..211,186.39 rows=1,423,325 width=92) (actual time=0.013..1,045.070 rows=1,451,852 loops=1)

  • Filter: ((id IS NOT NULL) AND (sport_id <> 98))
  • Rows Removed by Filter: 1,199,319
7. 0.015 0.043 ↑ 1.0 120 1

Hash (cost=6.20..6.20 rows=120 width=40) (actual time=0.043..0.043 rows=120 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
8. 0.028 0.028 ↑ 1.0 120 1

Seq Scan on burn_to_give_sport s (cost=0.00..6.20 rows=120 width=40) (actual time=0.003..0.028 rows=120 loops=1)

9. 429.823 1,376.350 ↓ 1.0 1,846,957 1

Subquery Scan on *SELECT* 2 (cost=0.00..119,584.55 rows=1,840,973 width=179) (actual time=0.039..1,376.350 rows=1,846,957 loops=1)

10. 326.199 946.527 ↓ 1.0 1,846,957 1

Nested Loop (cost=0.00..96,572.39 rows=1,840,973 width=179) (actual time=0.030..946.527 rows=1,846,957 loops=1)

11. 0.024 0.024 ↑ 1.0 1 1

Seq Scan on burn_to_give_sport s_1 (cost=0.00..6.50 rows=1 width=36) (actual time=0.020..0.024 rows=1 loops=1)

  • Filter: ((code)::text = 'steps'::text)
  • Rows Removed by Filter: 119
12. 620.304 620.304 ↓ 1.0 1,846,957 1

Seq Scan on burn_to_give_stepcounter sc (cost=0.00..73,553.73 rows=1,840,973 width=79) (actual time=0.005..620.304 rows=1,846,957 loops=1)

  • Filter: (id IS NOT NULL)
13. 0.813 0.813 ↑ 1.0 3,193 1

Seq Scan on burn_to_give_goodhabit g (cost=0.00..86.18 rows=3,218 width=382) (actual time=0.010..0.813 rows=3,193 loops=1)

  • Filter: (id IS NOT NULL)
14. 0.200 4.692 ↓ 1.3 1,511 1

Hash (cost=4,970.76..4,970.76 rows=1,205 width=8) (actual time=4.691..4.692 rows=1,511 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 76kB
15. 0.538 4.492 ↓ 1.3 1,511 1

Nested Loop (cost=5.36..4,970.76 rows=1,205 width=8) (actual time=0.035..4.492 rows=1,511 loops=1)

16. 0.172 0.930 ↓ 1.3 1,512 1

Nested Loop (cost=4.93..3,445.08 rows=1,205 width=4) (actual time=0.022..0.930 rows=1,512 loops=1)

17. 0.030 0.038 ↑ 1.4 20 1

Bitmap Heap Scan on burn_to_give_athletebychallenge (cost=4.51..80.30 rows=29 width=4) (actual time=0.014..0.038 rows=20 loops=1)

  • Recheck Cond: (challenge_id = 25)
  • Heap Blocks: exact=25
18. 0.008 0.008 ↓ 1.0 30 1

Bitmap Index Scan on burn_to_give_athletebychallenge_challenge_id_906e8312 (cost=0.00..4.50 rows=29 width=0) (actual time=0.008..0.008 rows=30 loops=1)

  • Index Cond: (challenge_id = 25)
19. 0.720 0.720 ↓ 1.2 76 20

Index Scan using burn_to_give_donationathle_athlete_challenge_id_56b0337f on burn_to_give_donationathletebychallenge (cost=0.42..115.40 rows=63 width=8) (actual time=0.004..0.036 rows=76 loops=20)

  • Index Cond: (athlete_challenge_id = burn_to_give_athletebychallenge.id)
20. 3.024 3.024 ↑ 1.0 1 1,512

Index Only Scan using index_2m_donation_id on view_materialized_activities_all (cost=0.43..1.27 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1,512)

  • Index Cond: ((donation_id = burn_to_give_donationathletebychallenge.donation_id) AND (donation_id IS NOT NULL))
  • Heap Fetches: 1,511
21. 4.533 4.533 ↑ 1.0 1 1,511

Index Scan using burn_to_give_donation_pkey on burn_to_give_donation (cost=0.43..0.54 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=1,511)

  • Index Cond: (id = t.donation_id)
  • Filter: (NOT is_private)
Planning time : 2.386 ms
Execution time : 3,249.885 ms