explain.depesz.com

PostgreSQL's explain analyze made readable

Result: a6XW

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Aggregate (cost=203,061,722.92..203,061,722.93 rows=1 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Merge Join (cost=7.46..203,058,125.43 rows=1,438,997 width=8) (actual rows= loops=)

  • Merge Cond: (shumantask0_.logicalgroup2 = sprocessin1_.id)
  • Join Filter: ((shumantask0_.assigneeid = suserimpl2_.id) OR ((shumantask0_.assigneeid = 0) AND (SubPlan 5)))
3. 0.000 0.000 ↓ 0.0

Index Scan using idx_fn_lg2_state_tenant_del on flownode_instance shumantask0_ (cost=0.41..5,066.29 rows=5,227 width=24) (actual rows= loops=)

  • Index Cond: (tenantid = 1)
  • Filter: (stable AND (NOT state_executing) AND (NOT terminal) AND ((kind)::text = ANY ('{user manual}'::text[])))
4. 0.000 0.000 ↓ 0.0

Materialize (cost=0.28..67,763.12 rows=4,451,844 width=16) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..56,633.51 rows=4,451,844 width=16) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Index Scan using process_instance_pkey on process_instance sprocessin1_ (cost=0.28..839.68 rows=1,047 width=8) (actual rows= loops=)

  • Index Cond: (tenantid = 1)
  • Filter: (processdefinitionid = 6961645213163614648::bigint)
7. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..156.41 rows=4,252 width=8) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on user_ suserimpl2_ (cost=0.00..135.15 rows=4,252 width=8) (actual rows= loops=)

  • Filter: (tenantid = 1)
9.          

SubPlan (forMerge Join)

10. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_uq_pending_mapping on pending_mapping spendingac3_ (cost=0.28..136.18 rows=3 width=0) (actual rows= loops=)

  • Index Cond: ((tenantid = 1) AND (activityid = shumantask0_.id))
  • Filter: ((userid = suserimpl2_.id) OR (alternatives: SubPlan 2 or hashed SubPlan 4))
11.          

SubPlan (forIndex Only Scan)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..19.83 rows=1 width=0) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on actor sactorimpl4_ (cost=0.00..1.55 rows=1 width=8) (actual rows= loops=)

  • Filter: ((tenantid = 1) AND (id = spendingac3_.actorid))
14. 0.000 0.000 ↓ 0.0

Index Only Scan using actormember_tenantid_actorid_userid_groupid_roleid_key on actormember sactormemb5_ (cost=0.14..18.27 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((tenantid = 1) AND (actorid = spendingac3_.actorid))
  • Filter: ((userid = suserimpl2_.id) OR (SubPlan 1))
15.          

SubPlan (forIndex Only Scan)

16. 0.000 0.000 ↓ 0.0

Index Only Scan using user_membership_tenantid_userid_roleid_groupid_key on user_membership susermembe6_ (cost=0.29..10.11 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((tenantid = 1) AND (userid = suserimpl2_.id))
  • Filter: (((sactormemb5_.groupid = groupid) AND (sactormemb5_.roleid <= 0)) OR ((sactormemb5_.roleid = roleid) AND (sactormemb5_.groupid <= 0)) OR ((sactormemb5_.groupid = groupid) AND (sactormemb5_.roleid = roleid)))
17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..393.91 rows=43 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on actor sactorimpl4__1 (cost=0.00..1.46 rows=37 width=8) (actual rows= loops=)

  • Filter: (tenantid = 1)
19. 0.000 0.000 ↓ 0.0

Index Only Scan using actormember_tenantid_actorid_userid_groupid_roleid_key on actormember sactormemb5__1 (cost=0.14..10.60 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((tenantid = 1) AND (actorid = sactorimpl4__1.id))
  • Filter: ((userid = suserimpl2_.id) OR (SubPlan 3))
20.          

SubPlan (forIndex Only Scan)

21. 0.000 0.000 ↓ 0.0

Index Only Scan using user_membership_tenantid_userid_roleid_groupid_key on user_membership susermembe6__1 (cost=0.29..10.11 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((tenantid = 1) AND (userid = suserimpl2_.id))
  • Filter: (((sactormemb5__1.groupid = groupid) AND (sactormemb5__1.roleid <= 0)) OR ((sactormemb5__1.roleid = roleid) AND (sactormemb5__1.groupid <= 0)) OR ((sactormemb5__1.groupid = groupid) AND (sactormemb5__1.roleid = (...)