explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iiqq

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.051 451.224 ↑ 1.0 20 1

Limit (cost=1.29..1,049.29 rows=20 width=243) (actual time=37.054..451.224 rows=20 loops=1)

2. 0.044 451.173 ↑ 40.5 20 1

Subquery Scan on delegation_data (cost=1.29..42,445.28 rows=810 width=243) (actual time=37.052..451.173 rows=20 loops=1)

  • Filter: ((NOT delegation_data.is_workflow_closed) OR (delegation_data.is_workflow_closed IS NULL))
  • Rows Removed by Filter: 4
3. 12.528 451.129 ↑ 67.1 24 1

Nested Loop Left Join (cost=1.29..42,429.17 rows=1,611 width=243) (actual time=37.049..451.129 rows=24 loops=1)

  • Join Filter: (au1.id = du.user_id)
4. 0.069 438.553 ↑ 67.1 24 1

Nested Loop Left Join (cost=1.00..41,141.90 rows=1,611 width=106) (actual time=36.223..438.553 rows=24 loops=1)

5. 0.081 438.460 ↑ 67.1 24 1

Nested Loop Left Join (cost=0.72..38,004.86 rows=1,611 width=95) (actual time=36.216..438.460 rows=24 loops=1)

6. 0.186 438.307 ↑ 67.1 24 1

Nested Loop (cost=0.43..37,500.14 rows=1,611 width=60) (actual time=36.205..438.307 rows=24 loops=1)

7. 0.372 1.027 ↓ 6.0 42 1

Nested Loop (cost=0.00..113.51 rows=7 width=48) (actual time=0.144..1.027 rows=42 loops=1)

  • Join Filter: (rg.entity_type_id = et.id)
  • Rows Removed by Join Filter: 371
8. 0.277 0.277 ↑ 1.9 42 1

Seq Scan on role_group rg (cost=0.00..79.23 rows=80 width=30) (actual time=0.079..0.277 rows=42 loops=1)

  • Filter: ((client_id = 1012) 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: 690
9. 0.316 0.378 ↑ 2.3 10 42

Materialize (cost=0.00..6.74 rows=23 width=22) (actual time=0.001..0.009 rows=10 loops=42)

10. 0.062 0.062 ↑ 1.0 23 1

Seq Scan on entity_type et (cost=0.00..6.62 rows=23 width=22) (actual time=0.019..0.062 rows=23 loops=1)

  • Filter: is_workflow_entity
  • Rows Removed by Filter: 237
11. 437.094 437.094 ↑ 752.0 1 42

Index Scan using domain_user_user_id_rg_id_entity_id_idx on domain_user du (cost=0.43..5,333.43 rows=752 width=16) (actual time=9.387..10.407 rows=1 loops=42)

  • Index Cond: ((user_id = 27984) AND (role_group_id = rg.id))
  • Filter: ((NOT entity_deleted) AND (sourceidfromentityid(rg.entity_type_id, entity_id) IS NOT NULL))
12. 0.072 0.072 ↓ 0.0 0 24

Index Scan using idx_delegated_domain_user_2 on delegated_domain_user ddu (cost=0.29..0.30 rows=1 width=39) (actual time=0.003..0.003 rows=0 loops=24)

  • Index Cond: (domain_user_id = du.id)
  • Filter: active
13. 0.024 0.024 ↓ 0.0 0 24

Index Scan using pk_app_user on app_user au2 (cost=0.29..1.95 rows=1 width=19) (actual time=0.001..0.001 rows=0 loops=24)

  • Index Cond: (id = ddu.delegated_user_id)
14. 0.033 0.048 ↑ 1.0 1 24

Materialize (cost=0.29..2.51 rows=1 width=19) (actual time=0.002..0.002 rows=1 loops=24)

15. 0.015 0.015 ↑ 1.0 1 1

Index Scan using pk_app_user on app_user au1 (cost=0.29..2.50 rows=1 width=19) (actual time=0.013..0.015 rows=1 loops=1)

  • Index Cond: (id = 27984)
Planning time : 1.442 ms
Execution time : 451.398 ms