explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 96Bc

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 0.534 ↑ 6.2 13 1

HashAggregate (cost=43.19..44.00 rows=81 width=156) (actual time=0.530..0.534 rows=13 loops=1)

  • Group Key: fcms.token
2. 0.029 0.517 ↑ 6.2 13 1

Nested Loop (cost=37.75..42.99 rows=81 width=156) (actual time=0.465..0.517 rows=13 loops=1)

  • Join Filter: (fcms.user_id = premium_user_subscriptions.user_id)
3. 0.037 0.450 ↓ 2.7 19 1

HashAggregate (cost=37.61..37.68 rows=7 width=12) (actual time=0.442..0.450 rows=19 loops=1)

  • Group Key: users.id
4. 0.031 0.413 ↓ 6.0 42 1

Nested Loop (cost=4.48..37.59 rows=7 width=12) (actual time=0.060..0.413 rows=42 loops=1)

5. 0.073 0.256 ↓ 6.0 42 1

Nested Loop (cost=4.20..34.96 rows=7 width=8) (actual time=0.026..0.256 rows=42 loops=1)

6. 0.060 0.060 ↓ 20.5 41 1

Seq Scan on subscriptions (cost=0.00..9.47 rows=2 width=8) (actual time=0.007..0.060 rows=41 loops=1)

  • Filter: ((end_at >= '2018-09-01 17:00:00'::timestamp without time zone) AND (end_at <= '2018-09-28 16:59:59.999999'::timestamp without time zone))
  • Rows Removed by Filter: 317
7. 0.082 0.123 ↑ 6.0 1 41

Bitmap Heap Scan on premium_user_subscriptions (cost=4.20..12.68 rows=6 width=16) (actual time=0.003..0.003 rows=1 loops=41)

  • Recheck Cond: (subscription_id = subscriptions.id)
  • Heap Blocks: exact=41
8. 0.041 0.041 ↑ 6.0 1 41

Bitmap Index Scan on index_premium_user_subscriptions_on_subscription_id (cost=0.00..4.20 rows=6 width=0) (actual time=0.001..0.001 rows=1 loops=41)

  • Index Cond: (subscription_id = subscriptions.id)
9. 0.126 0.126 ↑ 1.0 1 42

Index Only Scan using users_pkey on users (cost=0.28..0.38 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=42)

  • Index Cond: (id = premium_user_subscriptions.user_id)
  • Heap Fetches: 25
10. 0.038 0.038 ↑ 12.0 1 19

Index Scan using index_fcms_on_user_id on fcms (cost=0.15..0.61 rows=12 width=164) (actual time=0.002..0.002 rows=1 loops=19)

  • Index Cond: (user_id = users.id)