explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8PF

Settings
# exclusive inclusive rows x rows loops node
1. 0.078 4.165 ↓ 4.5 135 1

Unique (cost=474.49..475.24 rows=30 width=56) (actual time=4.061..4.165 rows=135 loops=1)

2. 0.192 4.087 ↓ 4.5 135 1

Sort (cost=474.49..474.56 rows=30 width=56) (actual time=4.060..4.087 rows=135 loops=1)

  • Sort Key: usr."Id", usr."Name", usr."UserName", s."ID", s."Category", s."ScopePriority", s."Value", s."ValueID", gs."ExcludeScope
  • Sort Method: quicksort Memory: 43kB
3. 0.061 3.895 ↓ 4.5 135 1

Nested Loop (cost=112.80..473.75 rows=30 width=56) (actual time=3.120..3.895 rows=135 loops=1)

4. 0.006 0.019 ↑ 1.0 1 1

Bitmap Heap Scan on "Settings" st (cost=8.61..12.63 rows=1 width=0) (actual time=0.018..0.019 rows=1 loops=1)

  • Recheck Cond: (("Value" = '1'::text) AND ("KeyId" = 4))
  • Heap Blocks: exact=1
5. 0.001 0.013 ↓ 0.0 0 1

BitmapAnd (cost=8.61..8.61 rows=1 width=0) (actual time=0.013..0.013 rows=0 loops=1)

6. 0.008 0.008 ↓ 7.8 31 1

Bitmap Index Scan on "IX_Settings_Value" (cost=0.00..4.18 rows=4 width=0) (actual time=0.008..0.008 rows=31 loops=1)

  • Index Cond: ("Value" = '1'::text)
7. 0.004 0.004 ↓ 12.8 51 1

Bitmap Index Scan on "IX_Settings_KeyId" (cost=0.00..4.18 rows=4 width=0) (actual time=0.004..0.004 rows=51 loops=1)

  • Index Cond: ("KeyId" = 4)
8. 0.094 3.815 ↓ 4.5 135 1

Nested Loop Left Join (cost=104.19..460.82 rows=30 width=56) (actual time=3.100..3.815 rows=135 loops=1)

9. 0.064 3.586 ↓ 4.5 135 1

Nested Loop Left Join (cost=104.05..454.81 rows=30 width=37) (actual time=3.096..3.586 rows=135 loops=1)

10. 0.228 3.462 ↓ 1.2 5 1

Hash Join (cost=103.91..450.88 rows=4 width=36) (actual time=3.088..3.462 rows=5 loops=1)

  • Hash Cond: (usr."Id" = ur."UserId")
11. 1.085 1.633 ↓ 2.0 906 1

Seq Scan on "ApplicationUser" usr (cost=23.95..369.20 rows=450 width=36) (actual time=0.560..1.633 rows=906 loops=1)

  • Filter: ((NOT (hashed SubPlan 1)) AND ("Status" = 6) AND ("IsBlocked" = 0))
  • Rows Removed by Filter: 691
12.          

SubPlan (forSeq Scan)

13. 0.548 0.548 ↑ 4.4 8 1

Index Scan using tasks_status_index on "Tasks" (cost=0.43..23.87 rows=35 width=4) (actual time=0.501..0.548 rows=8 loops=1)

  • Index Cond: ("Status" = ANY ('{0,4}'::integer[]))
  • Filter: (("UserID" IS NOT NULL) AND ("UserID" <> 0))
  • Rows Removed by Filter: 29
14. 0.045 1.601 ↓ 9.6 153 1

Hash (cost=79.75..79.75 rows=16 width=4) (actual time=1.601..1.601 rows=153 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
15. 0.797 1.556 ↓ 9.6 153 1

Hash Join (cost=19.49..79.75 rows=16 width=4) (actual time=0.027..1.556 rows=153 loops=1)

  • Hash Cond: (ur."RoleId" = r."Id")
16. 0.743 0.743 ↓ 1.0 3,313 1

Seq Scan on "UserRoles" ur (cost=0.00..51.64 rows=3,264 width=8) (actual time=0.007..0.743 rows=3,313 loops=1)

17. 0.002 0.016 ↑ 3.0 1 1

Hash (cost=19.45..19.45 rows=3 width=4) (actual time=0.016..0.016 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.014 0.014 ↑ 3.0 1 1

Seq Scan on "Roles" r (cost=0.00..19.45 rows=3 width=4) (actual time=0.010..0.014 rows=1 loops=1)

  • Filter: (lower("Name") = 'agent'::text)
  • Rows Removed by Filter: 6
19. 0.060 0.060 ↓ 1.1 27 5

Index Scan using "IX_GroupScope_TaskAssignmentGroupID" on "GroupScope" gs (cost=0.14..0.73 rows=25 width=9) (actual time=0.003..0.012 rows=27 loops=5)

  • Index Cond: ("TaskAssignmentGroupID" = usr."TaskAssignmentGroupID")
20. 0.135 0.135 ↑ 1.0 1 135

Index Scan using "PK_Scope" on "Scope" s (cost=0.14..0.20 rows=1 width=23) (actual time=0.001..0.001 rows=1 loops=135)

  • Index Cond: (gs."ScopeID" = "ID")
Planning time : 1.061 ms