explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1YgG

Settings
# exclusive inclusive rows x rows loops node
1. 10.991 226.679 ↑ 202.5 898 1

Hash Left Join (cost=61,896.78..1,380,051.62 rows=181,874 width=84) (actual time=166.678..226.679 rows=898 loops=1)

  • Output: accounts_bcdcompanyprofile.smid, accounts_bcdcompanyprofile.date_updated, accounts_bcdcompanyprofile.tspm_entity_id, accounts_bcdcompanyprofile.obt_client_id, accounts_bcdcompanyprofile.id, accounts_bcdcompanyprofile.is_folder, accounts_bcdcompanyprofile.parent_id, accounts_bcdcompanyprofile.title, accounts_user.email
  • Hash Cond: (accounts_bcduser.user_ptr_id = accounts_user.id)
  • Buffers: shared hit=62188, temp read=595 written=589
  • Planning time: 1.903 ms
  • Execution time: 226.930 ms
2. 27.087 107.344 ↑ 202.5 898 1

Merge Right Join (cost=47,591.04..1,358,522.11 rows=181,874 width=61) (actual time=2.357..107.344 rows=898 loops=1)

  • Output: accounts_bcdcompanyprofile.smid, accounts_bcdcompanyprofile.date_updated, accounts_bcdcompanyprofile.tspm_entity_id, accounts_bcdcompanyprofile.obt_client_id, accounts_bcdcompanyprofile.id, accounts_bcdcompanyprofile.is_folder, accounts_bcdcompanyprofile.parent_id, accounts_bcdcompanyprofile.title, accounts_bcduser.user_ptr_id
  • Merge Cond: (accounts_bcduser.user_ptr_id = accounts_bcdcompanyprofile.updated_by_id)
  • Buffers: shared hit=51378
3. 36.064 36.064 ↑ 1.1 109,187 1

Index Only Scan using accounts_bcduser_pkey on public.accounts_bcduser (cost=0.42..4,003.72 rows=119,144 width=4) (actual time=0.029..36.064 rows=109,187 loops=1)

  • Output: accounts_bcduser.user_ptr_id
  • Heap Fetches: 21680
  • Buffers: shared hit=8561
4. 41.927 44.193 ↑ 202.5 898 1

Index Scan using accounts_bcdcompanyprofile_updated_by_id on public.accounts_bcdcompanyprofile (cost=47,590.62..1,352,308.69 rows=181,874 width=61) (actual time=2.324..44.193 rows=898 loops=1)

  • Output: accounts_bcdcompanyprofile.smid, accounts_bcdcompanyprofile.date_updated, accounts_bcdcompanyprofile.tspm_entity_id, accounts_bcdcompanyprofile.obt_client_id, accounts_bcdcompanyprofile.id, accounts_bcdcompanyprofile.is_folder, accounts_bcdcompanyprofile.parent_id, accounts_bcdcompanyprofile.title, accounts_bcdcompanyprofile.updated_by_id
  • Filter: ((hashed SubPlan 1) OR (accounts_bcdcompanyprofile.parent_id IS NULL))
  • Rows Removed by Filter: 41991
  • Buffers: shared hit=42817
5.          

SubPlan (forIndex Scan)

6. 1.989 2.266 ↑ 1,757.1 7 1

Bitmap Heap Scan on public.accounts_bcdcompanyprofile u0 (cost=207.09..47,559.45 rows=12,300 width=4) (actual time=0.503..2.266 rows=7 loops=1)

  • Output: u0.id
  • Recheck Cond: (u0.lft <= 2841)
  • Filter: ((u0.rght >= 2842) AND (u0.tree_id = 1))
  • Rows Removed by Filter: 1417
  • Heap Blocks: exact=1283
  • Buffers: shared hit=1294
7. 0.277 0.277 ↑ 9.0 1,424 1

Bitmap Index Scan on accounts_bcdcompanyprofile_lft (cost=0.00..204.02 rows=12,746 width=0) (actual time=0.277..0.277 rows=1,424 loops=1)

  • Index Cond: (u0.lft <= 2841)
  • Buffers: shared hit=11
8. 53.376 108.344 ↑ 1.0 119,144 1

Hash (cost=12,001.44..12,001.44 rows=119,144 width=31) (actual time=108.344..108.344 rows=119,144 loops=1)

  • Output: accounts_user.email, accounts_user.id
  • Buckets: 65536 Batches: 4 Memory Usage: 2412kB
  • Buffers: shared hit=10810, temp written=576
9. 54.968 54.968 ↑ 1.0 119,144 1

Seq Scan on public.accounts_user (cost=0.00..12,001.44 rows=119,144 width=31) (actual time=0.002..54.968 rows=119,144 loops=1)

  • Output: accounts_user.email, accounts_user.id
  • Buffers: shared hit=10810