explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MNRG

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 4.736 ↑ 1.0 20 1

Limit (cost=0.00..9,861.89 rows=20 width=102) (actual time=0.136..4.736 rows=20 loops=1)

2. 2.504 4.724 ↑ 16,502.1 20 1

Seq Scan on accounts a (cost=0.00..162,741,910.06 rows=330,042 width=102) (actual time=0.132..4.724 rows=20 loops=1)

  • Filter: ((deleted_at IS NULL) AND (updated_at > '1970-01-01 00:00:00'::timestamp without time zone) AND (type_name = 'personal'::itv.account_type_enum) AND (home_mrf = 'mos'::text))
  • Rows Removed by Filter: 3809
3.          

SubPlan (for Seq Scan)

4. 0.200 1.300 ↑ 1.0 1 20

Aggregate (cost=241.67..241.69 rows=1 width=32) (actual time=0.065..0.065 rows=1 loops=20)

5. 0.030 1.100 ↑ 1.0 1 20

Nested Loop (cost=0.99..241.67 rows=1 width=8) (actual time=0.049..0.055 rows=1 loops=20)

6. 0.440 0.440 ↑ 1.0 1 20

Index Scan using devices_accounts_id_idx on devices d (cost=0.43..8.45 rows=1 width=41) (actual time=0.021..0.022 rows=1 loops=20)

  • Index Cond: (a.id = account_id)
7. 0.630 0.630 ↑ 57.0 1 14

Index Scan using sessions_uid_deleted_at_idx on sessions s (cost=0.56..232.65 rows=57 width=41) (actual time=0.043..0.045 rows=1 loops=14)

  • Index Cond: ((uid = d.uid) AND (deleted_at IS NULL))
8. 0.224 0.920 ↑ 1.0 1 20

Aggregate (cost=249.86..249.88 rows=1 width=32) (actual time=0.045..0.046 rows=1 loops=20)

9. 0.080 0.080 ↑ 1.0 1 20

Index Scan using devices_accounts_id_idx on devices d_1 (cost=0.43..8.45 rows=1 width=219) (actual time=0.003..0.004 rows=1 loops=20)

  • Index Cond: (a.id = account_id)
10.          

SubPlan (for Aggregate)

11. 0.126 0.266 ↑ 1.0 1 14

Aggregate (cost=232.94..232.95 rows=1 width=32) (actual time=0.019..0.019 rows=1 loops=14)

12. 0.140 0.140 ↑ 57.0 1 14

Index Scan using sessions_uid_deleted_at_idx on sessions (cost=0.56..232.65 rows=57 width=55) (actual time=0.009..0.010 rows=1 loops=14)

  • Index Cond: ((uid = d_1.uid) AND (deleted_at IS NULL))
13. 0.350 0.350 ↑ 1.0 1 14

Index Scan using pk_profiles on profiles (cost=0.44..8.46 rows=1 width=32) (actual time=0.025..0.025 rows=1 loops=14)

  • Index Cond: (id = d_1.current_profile_id)
Planning time : 3.673 ms