explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8W1S

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.127 ↓ 0.0 0 1

Unique (cost=42.91..42.92 rows=1 width=156) (actual time=0.127..0.127 rows=0 loops=1)

2. 0.020 0.126 ↓ 0.0 0 1

Sort (cost=42.91..42.91 rows=1 width=156) (actual time=0.126..0.126 rows=0 loops=1)

  • Sort Key: fcms.token
  • Sort Method: quicksort Memory: 25kB
3. 0.002 0.106 ↓ 0.0 0 1

Nested Loop (cost=4.62..42.90 rows=1 width=156) (actual time=0.106..0.106 rows=0 loops=1)

  • Join Filter: (premium_user_subscriptions.user_id = fcms.user_id)
4. 0.002 0.089 ↑ 7.0 1 1

Nested Loop (cost=4.48..37.59 rows=7 width=12) (actual time=0.055..0.089 rows=1 loops=1)

5. 0.003 0.060 ↑ 7.0 1 1

Nested Loop (cost=4.20..34.96 rows=7 width=8) (actual time=0.027..0.060 rows=1 loops=1)

6. 0.045 0.045 ↑ 2.0 1 1

Seq Scan on subscriptions (cost=0.00..9.47 rows=2 width=8) (actual time=0.012..0.045 rows=1 loops=1)

  • Filter: ((end_at >= '2018-09-29 17:00:00'::timestamp without time zone) AND (end_at <= '2018-09-30 16:59:59.999999'::timestamp without time zone))
  • Rows Removed by Filter: 357
7. 0.006 0.012 ↑ 6.0 1 1

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

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

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

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

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

  • Index Cond: (id = premium_user_subscriptions.user_id)
  • Heap Fetches: 0
10. 0.015 0.015 ↓ 0.0 0 1

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

  • Index Cond: (user_id = users.id)