explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QZcJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 1,329.286 ↑ 1.0 1 1

Limit (cost=15,691,410.81..15,691,410.82 rows=1 width=8) (actual time=1,329.283..1,329.286 rows=1 loops=1)

  • Output: (count(DISTINCT shumantask0_.id))
  • Buffers: shared hit=43336
2. 0.330 1,329.279 ↑ 1.0 1 1

Aggregate (cost=15,691,410.81..15,691,410.82 rows=1 width=8) (actual time=1,329.279..1,329.279 rows=1 loops=1)

  • Output: count(DISTINCT shumantask0_.id)
  • Buffers: shared hit=43336
3. 397.824 1,328.949 ↑ 1,420.3 79 1

Nested Loop (cost=0.00..15,691,130.31 rows=112,200 width=8) (actual time=17.858..1,328.949 rows=79 loops=1)

  • Output: shumantask0_.id
  • Join Filter: ((shumantask0_.assigneeid = suserimpl2_.id) OR ((shumantask0_.assigneeid = 0) AND (SubPlan 5)))
  • Rows Removed by Join Filter: 331098
  • Buffers: shared hit=43330
4. 52.137 100.922 ↑ 1.0 77 1

Nested Loop (cost=0.00..1,181.53 rows=80 width=16) (actual time=3.698..100.922 rows=77 loops=1)

  • Output: shumantask0_.id, shumantask0_.assigneeid
  • Join Filter: (shumantask0_.logicalgroup2 = sprocessin1_.id)
  • Rows Removed by Join Filter: 49203
  • Buffers: shared hit=199
5. 0.737 0.737 ↑ 1.0 77 1

Seq Scan on public.process_instance sprocessin1_ (cost=0.00..46.99 rows=77 width=8) (actual time=0.015..0.737 rows=77 loops=1)

  • Output: sprocessin1_.tenantid, sprocessin1_.id, sprocessin1_.name, sprocessin1_.processdefinitionid, sprocessin1_.description, sprocessin1_.startdate, sprocessin1_.startedby, sprocessin1_.startedbysubstitute, sprocessin1_.enddate, sprocessin1_.stateid, sprocessin1_.statecategory, sprocessin1_.lastupdate, sprocessin1_.containerid, sprocessin1_.rootprocessinstanceid, sprocessin1_.callerid, sprocessin1_.callertype, sprocessin1_.interruptingeventid, sprocessin1_.stringindex1, sprocessin1_.stringindex2, sprocessin1_.stringindex3, sprocessin1_.stringindex4, sprocessin1_.stringindex5
  • Filter: ((sprocessin1_.tenantid = 1) AND (sprocessin1_.processdefinitionid = 6961645213163614648::bigint))
  • Rows Removed by Filter: 656
  • Buffers: shared hit=36
6. 46.128 48.048 ↑ 1.3 640 77

Materialize (cost=0.00..188.33 rows=821 width=24) (actual time=0.001..0.624 rows=640 loops=77)

  • Output: shumantask0_.id, shumantask0_.logicalgroup2, shumantask0_.assigneeid
  • Buffers: shared hit=163
7. 1.920 1.920 ↑ 1.3 640 1

Seq Scan on public.flownode_instance shumantask0_ (cost=0.00..184.22 rows=821 width=24) (actual time=0.008..1.920 rows=640 loops=1)

  • Output: shumantask0_.id, shumantask0_.logicalgroup2, shumantask0_.assigneeid
  • Filter: (shumantask0_.stable AND (NOT shumantask0_.state_executing) AND (NOT shumantask0_.terminal) AND ((shumantask0_.kind)::text = ANY ('{user,manual}'::text[])) AND (shumantask0_.tenantid = 1))
  • Rows Removed by Filter: 460
  • Buffers: shared hit=163
8. 308.699 314.083 ↑ 1.0 4,301 77

Materialize (cost=0.00..198.27 rows=4,301 width=8) (actual time=0.001..4.079 rows=4,301 loops=77)

  • Output: suserimpl2_.id
  • Buffers: shared hit=123
9. 5.384 5.384 ↑ 1.0 4,301 1

Seq Scan on public.user_ suserimpl2_ (cost=0.00..176.76 rows=4,301 width=8) (actual time=0.015..5.384 rows=4,301 loops=1)

  • Output: suserimpl2_.id
  • Filter: (suserimpl2_.tenantid = 1)
  • Buffers: shared hit=123
10.          

SubPlan (forNested Loop)

11. 103.368 516.120 ↓ 0.0 0 8,602

Index Only Scan using idx_uq_pending_mapping on public.pending_mapping spendingac3_ (cost=0.28..136.19 rows=3 width=0) (actual time=0.060..0.060 rows=0 loops=8,602)

  • Index Cond: ((spendingac3_.tenantid = 1) AND (spendingac3_.activityid = shumantask0_.id))
  • Filter: ((spendingac3_.userid = suserimpl2_.id) OR (alternatives: SubPlan 2 or hashed SubPlan 4))
  • Rows Removed by Filter: 2
  • Heap Fetches: 17202
  • Buffers: shared hit=43008
12.          

SubPlan (forIndex Only Scan)

13. 103.188 412.752 ↓ 0.0 0 17,198

Nested Loop (cost=0.14..20.42 rows=1 width=0) (actual time=0.024..0.024 rows=0 loops=17,198)

  • Buffers: shared hit=17198
14. 309.564 309.564 ↓ 0.0 0 17,198

Seq Scan on public.actor sactorimpl4_ (cost=0.00..2.14 rows=1 width=8) (actual time=0.018..0.018 rows=0 loops=17,198)

  • Output: sactorimpl4_.tenantid, sactorimpl4_.id, sactorimpl4_.scopeid, sactorimpl4_.name, sactorimpl4_.displayname, sactorimpl4_.description, sactorimpl4_.initiator
  • Filter: ((sactorimpl4_.tenantid = 1) AND (sactorimpl4_.id = spendingac3_.actorid))
  • Rows Removed by Filter: 76
  • Buffers: shared hit=17198
15. 0.000 0.000 ↓ 0.0 0

Index Only Scan using actormember_tenantid_actorid_userid_groupid_roleid_key on public.actormember sactormemb5_ (cost=0.14..18.27 rows=1 width=8) (never executed)

  • Output: sactormemb5_.tenantid, sactormemb5_.actorid, sactormemb5_.userid, sactormemb5_.groupid, sactormemb5_.roleid
  • Index Cond: ((sactormemb5_.tenantid = 1) AND (sactormemb5_.actorid = spendingac3_.actorid))
  • Filter: ((sactormemb5_.userid = suserimpl2_.id) OR (SubPlan 1))
  • Heap Fetches: 0
16.          

SubPlan (forIndex Only Scan)

17. 0.000 0.000 ↓ 0.0 0

Index Only Scan using user_membership_tenantid_userid_roleid_groupid_key on public.user_membership susermembe6_ (cost=0.29..10.11 rows=1 width=0) (never executed)

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

Nested Loop (cost=0.14..795.42 rows=57 width=8) (never executed)

  • Output: sactorimpl4__1.id
19. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.actor sactorimpl4__1 (cost=0.00..1.95 rows=76 width=8) (never executed)

  • Output: sactorimpl4__1.tenantid, sactorimpl4__1.id, sactorimpl4__1.scopeid, sactorimpl4__1.name, sactorimpl4__1.displayname, sactorimpl4__1.description, sactorimpl4__1.initiator
  • Filter: (sactorimpl4__1.tenantid = 1)
20. 0.000 0.000 ↓ 0.0 0

Index Only Scan using actormember_tenantid_actorid_userid_groupid_roleid_key on public.actormember sactormemb5__1 (cost=0.14..10.43 rows=1 width=8) (never executed)

  • Output: sactormemb5__1.tenantid, sactormemb5__1.actorid, sactormemb5__1.userid, sactormemb5__1.groupid, sactormemb5__1.roleid
  • Index Cond: ((sactormemb5__1.tenantid = 1) AND (sactormemb5__1.actorid = sactorimpl4__1.id))
  • Filter: ((sactormemb5__1.userid = suserimpl2_.id) OR (SubPlan 3))
  • Heap Fetches: 0
21.          

SubPlan (forIndex Only Scan)

22. 0.000 0.000 ↓ 0.0 0

Index Only Scan using user_membership_tenantid_userid_roleid_groupid_key on public.user_membership susermembe6__1 (cost=0.29..10.11 rows=1 width=0) (never executed)

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