explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Y89s

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 20.224 ↑ 1.0 20 1

Limit (cost=110.56..762.72 rows=20 width=240) (actual time=1.567..20.224 rows=20 loops=1)

2. 0.027 20.211 ↑ 3.5 20 1

Subquery Scan on delegation_data (cost=110.56..2,425.73 rows=71 width=240) (actual time=1.566..20.211 rows=20 loops=1)

  • Filter: ((NOT delegation_data.is_workflow_closed) OR (delegation_data.is_workflow_closed IS NULL))
3. 14.712 20.184 ↑ 7.0 20 1

Nested Loop Left Join (cost=110.56..2,424.32 rows=141 width=240) (actual time=1.564..20.184 rows=20 loops=1)

  • Join Filter: (au1.id = du.user_id)
4. 0.150 5.452 ↑ 7.0 20 1

Nested Loop Left Join (cost=110.28..2,303.57 rows=141 width=105) (actual time=0.786..5.452 rows=20 loops=1)

  • Join Filter: (ddu.domain_user_id = du.id)
  • Rows Removed by Join Filter: 659
5. 0.025 4.942 ↑ 7.0 20 1

Nested Loop (cost=110.00..2,103.75 rows=141 width=57) (actual time=0.691..4.942 rows=20 loops=1)

6. 0.004 0.087 ↑ 3.7 3 1

Nested Loop (cost=0.14..70.05 rows=11 width=45) (actual time=0.062..0.087 rows=3 loops=1)

7. 0.056 0.056 ↑ 39.7 3 1

Seq Scan on role_group rg (cost=0.00..25.52 rows=119 width=27) (actual time=0.043..0.056 rows=3 loops=1)

  • Filter: ((client_id = 1005) AND (entity_type_id = ANY ('{1,61,12,13,14,15,16,17,28,18,63,67,80,165,176,181,64,160}'::integer[])))
  • Rows Removed by Filter: 75
8. 0.027 0.027 ↑ 1.0 1 3

Index Scan using pk_entity_type on entity_type et (cost=0.14..0.36 rows=1 width=22) (actual time=0.008..0.009 rows=1 loops=3)

  • Index Cond: (id = rg.entity_type_id)
  • Filter: is_workflow_entity
9. 4.173 4.830 ↑ 3.0 7 3

Bitmap Heap Scan on domain_user du (cost=109.86..184.67 rows=21 width=16) (actual time=0.413..1.610 rows=7 loops=3)

  • Recheck Cond: ((user_id = 1251) AND (role_group_id = rg.id))
  • Filter: ((NOT entity_deleted) AND (sourceidfromentityid(rg.entity_type_id, entity_id) IS NOT NULL))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=16
10. 0.657 0.657 ↑ 2.1 11 3

Bitmap Index Scan on domain_user_user_id_rg_id_entity_id_idx (cost=0.00..109.85 rows=23 width=0) (actual time=0.219..0.219 rows=11 loops=3)

  • Index Cond: ((user_id = 1251) AND (role_group_id = rg.id))
11. 0.056 0.360 ↓ 2.1 33 20

Materialize (cost=0.28..166.02 rows=16 width=52) (actual time=0.002..0.018 rows=33 loops=20)

12. 0.017 0.304 ↓ 2.1 33 1

Nested Loop Left Join (cost=0.28..165.94 rows=16 width=52) (actual time=0.016..0.304 rows=33 loops=1)

13. 0.221 0.221 ↓ 2.1 33 1

Seq Scan on delegated_domain_user ddu (cost=0.00..61.06 rows=16 width=39) (actual time=0.007..0.221 rows=33 loops=1)

  • Filter: active
  • Rows Removed by Filter: 1997
14. 0.066 0.066 ↑ 1.0 1 33

Index Scan using pk_app_user on app_user au2 (cost=0.28..6.54 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=33)

  • Index Cond: (id = ddu.delegated_user_id)
15. 0.012 0.020 ↑ 1.0 1 20

Materialize (cost=0.28..8.30 rows=1 width=21) (actual time=0.001..0.001 rows=1 loops=20)

16. 0.008 0.008 ↑ 1.0 1 1

Index Scan using pk_app_user on app_user au1 (cost=0.28..8.29 rows=1 width=21) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (id = 1251)