explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QfmF

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 404.846 ↑ 1.0 1 1

Subquery Scan on user_statistic (cost=16,528.68..16,528.74 rows=1 width=144) (actual time=404.844..404.846 rows=1 loops=1)

2. 0.058 404.829 ↑ 1.0 1 1

GroupAggregate (cost=16,528.68..16,528.72 rows=1 width=80) (actual time=404.829..404.829 rows=1 loops=1)

  • Group Key: (timezone('MSK'::text, date_trunc('month'::text, timezone('MSK'::text, (user_hourly_statistics.start_time)::timestamp with time zone))))
3. 1.253 404.771 ↓ 29.0 29 1

Sort (cost=16,528.68..16,528.68 rows=1 width=23) (actual time=404.764..404.771 rows=29 loops=1)

  • Sort Key: (timezone('MSK'::text, date_trunc('month'::text, timezone('MSK'::text, (user_hourly_statistics.start_time)::timestamp with time zone))))
  • Sort Method: quicksort Memory: 27kB
4. 0.441 403.518 ↓ 29.0 29 1

Nested Loop (cost=284.95..16,528.67 rows=1 width=23) (actual time=183.858..403.518 rows=29 loops=1)

5. 325.908 374.327 ↓ 250.0 250 1

Bitmap Heap Scan on users (cost=284.51..16,355.34 rows=1 width=4) (actual time=66.588..374.327 rows=250 loops=1)

  • Recheck Cond: ((created_at >= ('2019-12-01 00:00 MSK'::cstring)::timestamp with time zone) AND (created_at <= ('2019-12-01 23:59 MSK'::cstring)::timestamp with time zone))
  • Filter: ((iphone OR ipad) AND ((install_source)::text = 'testbonus'::text))
  • Rows Removed by Filter: 4581
  • Heap Blocks: exact=4641
6. 48.419 48.419 ↓ 1.1 4,867 1

Bitmap Index Scan on index_users_on_created_at (cost=0.00..284.51 rows=4,394 width=0) (actual time=48.419..48.419 rows=4,867 loops=1)

  • Index Cond: ((created_at >= ('2019-12-01 00:00 MSK'::cstring)::timestamp with time zone) AND (created_at <= ('2019-12-01 23:59 MSK'::cstring)::timestamp with time zone))
7. 28.750 28.750 ↓ 0.0 0 250

Index Scan using index_user_hourly_statistics_on_user_id on user_hourly_statistics (cost=0.44..173.30 rows=2 width=23) (actual time=0.043..0.115 rows=0 loops=250)

  • Index Cond: (user_id = users.id)
  • Filter: ((start_time >= '2019-12-31 21:00:00'::timestamp without time zone) AND (start_time <= '2020-01-31 20:59:59'::timestamp without time zone))
  • Rows Removed by Filter: 2
Planning time : 20.096 ms
Execution time : 408.383 ms