explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 57Bv

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 16,939.023 ↑ 1.0 2 1

Limit (cost=0.00..6,744,733.29 rows=2 width=102) (actual time=9,820.181..16,939.023 rows=2 loops=1)

2. 0.998 16,939.014 ↑ 46,915.0 2 1

Seq Scan on accounts a (cost=0.00..316,429,162,224.73 rows=93,830 width=102) (actual time=9,820.179..16,939.014 rows=2 loops=1)

  • Filter: ((deleted_at IS NULL) AND (type_name = 'personal'::account_type_enum) AND (home_mrf = 'mos'::text))
  • Rows Removed by Filter: 410
3.          

SubPlan (for Seq Scan)

4. 0.252 16,884.476 ↑ 1.0 1 2

Aggregate (cost=264,855.80..264,855.82 rows=1 width=32) (actual time=8,442.238..8,442.238 rows=1 loops=2)

5. 3,706.878 16,884.224 ↑ 6,865.5 2 2

Hash Join (cost=38,016.81..264,821.47 rows=13,731 width=8) (actual time=1,803.215..8,442.112 rows=2 loops=2)

  • Hash Cond: (s.uid = d.uid)
6. 13,163.112 13,163.112 ↓ 1.0 2,746,803 2

Seq Scan on sessions s (cost=0.00..219,595.57 rows=2,746,319 width=41) (actual time=0.013..6,581.556 rows=2,746,803 loops=2)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 3400134
7. 0.050 14.234 ↑ 6,864.5 2 2

Hash (cost=37,845.19..37,845.19 rows=13,729 width=41) (actual time=7.117..7.117 rows=2 loops=2)

  • Buckets: 16384 Batches: 1 Memory Usage: 129kB
8. 14.098 14.184 ↑ 6,864.5 2 2

Bitmap Heap Scan on devices d (cost=258.83..37,845.19 rows=13,729 width=41) (actual time=5.031..7.092 rows=2 loops=2)

  • Recheck Cond: (a.id = account_id)
  • Heap Blocks: exact=3
9. 0.086 0.086 ↑ 6,864.5 2 2

Bitmap Index Scan on devices_accounts_id_idx (cost=0.00..255.40 rows=13,729 width=0) (actual time=0.042..0.043 rows=2 loops=2)

  • Index Cond: (a.id = account_id)
10. 0.229 53.540 ↑ 1.0 1 2

Aggregate (cost=3,107,508.92..3,107,508.94 rows=1 width=32) (actual time=26.770..26.770 rows=1 loops=2)

11. 0.048 0.094 ↑ 6,864.5 2 2

Bitmap Heap Scan on devices d_1 (cost=258.83..37,845.19 rows=13,729 width=210) (actual time=0.042..0.047 rows=2 loops=2)

  • Recheck Cond: (a.id = account_id)
  • Heap Blocks: exact=3
12. 0.046 0.046 ↑ 6,864.5 2 2

Bitmap Index Scan on devices_accounts_id_idx (cost=0.00..255.40 rows=13,729 width=0) (actual time=0.023..0.023 rows=2 loops=2)

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

SubPlan (for Aggregate)

14. 0.351 26.412 ↑ 1.0 1 3

Aggregate (cost=215.12..215.13 rows=1 width=32) (actual time=8.804..8.804 rows=1 loops=3)

15. 0.039 26.061 ↑ 53.0 1 3

Bitmap Heap Scan on sessions (cost=5.10..214.85 rows=53 width=51) (actual time=8.686..8.687 rows=1 loops=3)

  • Recheck Cond: ((uid = d_1.uid) AND (deleted_at IS NULL))
  • Heap Blocks: exact=3
16. 26.022 26.022 ↑ 53.0 1 3

Bitmap Index Scan on sessions_uid_deleted_at_idx (cost=0.00..5.09 rows=53 width=0) (actual time=8.674..8.674 rows=1 loops=3)

  • Index Cond: ((uid = d_1.uid) AND (deleted_at IS NULL))
17. 26.805 26.805 ↑ 1.0 1 3

Index Scan using pk_profiles on profiles (cost=0.43..8.45 rows=1 width=32) (actual time=8.933..8.935 rows=1 loops=3)