explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rfo4

Settings
# exclusive inclusive rows x rows loops node
1. 4.071 703.374 ↑ 200.0 1 1

HashAggregate (cost=7,961.93..7,963.93 rows=200 width=45) (actual time=703.360..703.374 rows=1 loops=1)

  • Group Key: al.identity_id
  • Buffers: shared hit=2509
2. 14.188 699.303 ↑ 23.0 505 1

HashAggregate (cost=7,642.85..7,787.89 rows=11,603 width=53) (actual time=695.095..699.303 rows=505 loops=1)

  • Group Key: al.identity_id, al.start_time
  • Buffers: shared hit=2509
3.          

CTE tz

4. 0.037 0.531 ↑ 1.0 1 1

Result (cost=0.58..0.59 rows=1 width=32) (actual time=0.517..0.531 rows=1 loops=1)

  • Buffers: shared hit=9
5.          

Initplan (forResult)

6. 0.034 0.494 ↑ 1.0 1 1

Limit (cost=0.00..0.29 rows=1 width=32) (actual time=0.465..0.494 rows=1 loops=1)

  • Buffers: shared hit=9
7. 0.460 0.460 ↑ 61,283.0 1 1

Seq Scan on activity_log_activitylog (cost=0.00..17,647.85 rows=61,283 width=32) (actual time=0.446..0.460 rows=1 loops=1)

  • Filter: ((((identity_id)::text = 'bb6eb20e-efd2-4828-8286-9657822e5353'::text) AND ((datasource)::text = 'applehealth'::text)) OR ((datasource)::text = 'googlefit'::text))
  • Rows Removed by Filter: 377
  • Buffers: shared hit=9
8. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.00..0.29 rows=1 width=32) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Seq Scan on activity_log_activitylog activity_log_activitylog_1 (cost=0.00..17,647.85 rows=61,283 width=32) (never executed)

  • Filter: ((((identity_id)::text = 'bb6eb20e-efd2-4828-8286-9657822e5353'::text) AND ((datasource)::text = 'applehealth'::text)) OR ((datasource)::text = 'googlefit'::text))
10. 357.016 685.115 ↑ 11.6 1,004 1

Nested Loop (cost=0.42..7,555.24 rows=11,603 width=53) (actual time=0.834..685.115 rows=1,004 loops=1)

  • Join Filter: (al.start_time >= timezone('UTC'::text, timezone(tz."offset", date_trunc('day'::text, timezone(tz."offset", LOCALTIMESTAMP)))))
  • Rows Removed by Join Filter: 34372
  • Buffers: shared hit=2509
11. 0.568 0.568 ↑ 1.0 1 1

CTE Scan on tz (cost=0.00..0.02 rows=1 width=32) (actual time=0.539..0.568 rows=1 loops=1)

  • Buffers: shared hit=9
12. 327.531 327.531 ↓ 1.0 35,376 1

Index Scan using activity_log_activitylog_user_id_facfa596 on activity_log_activitylog al (cost=0.42..6,685.00 rows=34,809 width=53) (actual time=0.236..327.531 rows=35,376 loops=1)

  • Index Cond: ((identity_id)::text = 'bb6eb20e-efd2-4828-8286-9657822e5353'::text)
  • Filter: ((steps > '0'::double precision) AND (start_time <= CURRENT_TIMESTAMP))
  • Rows Removed by Filter: 51024
  • Buffers: shared hit=2500
Planning time : 9.713 ms