explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XhL9

Settings
# exclusive inclusive rows x rows loops node
1. 0.029 381.445 ↑ 1.0 20 1

Limit (cost=0.00..62,154,696.89 rows=20 width=70) (actual time=13.552..381.445 rows=20 loops=1)

2. 2.256 381.416 ↑ 4,691.5 20 1

Seq Scan on accounts a (cost=0.00..291,598,760,480.43 rows=93,830 width=70) (actual time=13.550..381.416 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'::account_type_enum) AND (home_mrf = 'mos'::text))
  • Rows Removed by Filter: 1,533
3.          

SubPlan (for Seq Scan)

4. 1.160 379.160 ↑ 1.0 1 20

Aggregate (cost=3,107,732.86..3,107,732.87 rows=1 width=32) (actual time=18.958..18.958 rows=1 loops=20)

5. 111.580 144.240 ↑ 13,730.0 1 20

Bitmap Heap Scan on devices d (cost=258.84..37,845.28 rows=13,730 width=210) (actual time=6.431..7.212 rows=1 loops=20)

  • Recheck Cond: (a.id = account_id)
  • Heap Blocks: exact=24
6. 32.660 32.660 ↑ 13,730.0 1 20

Bitmap Index Scan on devices_accounts_id_idx (cost=0.00..255.41 rows=13,730 width=0) (actual time=1.633..1.633 rows=1 loops=20)

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

SubPlan (for Aggregate)

8. 0.744 94.584 ↑ 1.0 1 24

Aggregate (cost=215.12..215.13 rows=1 width=32) (actual time=3.941..3.941 rows=1 loops=24)

9. 0.288 93.840 ↑ 53.0 1 24

Bitmap Heap Scan on sessions (cost=5.10..214.85 rows=53 width=51) (actual time=3.909..3.910 rows=1 loops=24)

  • Recheck Cond: ((uid = d.uid) AND (deleted_at IS NULL))
  • Heap Blocks: exact=19
10. 93.552 93.552 ↑ 53.0 1 24

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

  • Index Cond: ((uid = d.uid) AND (deleted_at IS NULL))
11. 139.176 139.176 ↑ 1.0 1 24

Index Scan using pk_profiles on profiles (cost=0.43..8.45 rows=1 width=32) (actual time=5.797..5.799 rows=1 loops=24)

  • Index Cond: (id = d.current_profile_id)