explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YYlh

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 532.779 ↑ 1.1 27 1

Unique (cost=505,181.89..505,182.64 rows=30 width=56) (actual time=532.757..532.779 rows=27 loops=1)

2. 0.071 532.759 ↑ 1.1 27 1

Sort (cost=505,181.89..505,181.97 rows=30 width=56) (actual time=532.753..532.759 rows=27 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: 28kB
3. 0.014 532.688 ↑ 1.1 27 1

Nested Loop (cost=503,756.47..505,181.15 rows=30 width=56) (actual time=528.848..532.688 rows=27 loops=1)

4. 0.007 0.021 ↑ 1.0 1 1

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

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

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

6. 0.010 0.010 ↓ 7.8 31 1

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

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

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

  • Index Cond: ("KeyId" = 4)
8. 1.084 532.653 ↑ 1.1 27 1

Merge Join (cost=503,747.86..505,168.23 rows=30 width=56) (actual time=528.826..532.653 rows=27 loops=1)

  • Merge Cond: (usr."Id" = ur."UserId")
9. 2.286 529.345 ↓ 1.5 4,935 1

Nested Loop Left Join (cost=503,667.79..505,079.47 rows=3,278 width=56) (actual time=521.194..529.345 rows=4,935 loops=1)

10. 1.376 522.571 ↓ 1.7 748 1

Index Scan using "PK_ApplicationUser" on "ApplicationUser" usr (cost=503,665.99..504,677.99 rows=434 width=36) (actual time=521.169..522.571 rows=748 loops=1)

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

SubPlan (forIndex Scan)

12. 11.393 521.195 ↑ 4.8 11 1

Gather (cost=1,000.00..503,665.58 rows=53 width=4) (actual time=289.150..521.195 rows=11 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
13. 509.802 509.802 ↑ 5.5 4 3

Parallel Seq Scan on "Tasks" (cost=0.00..502,660.28 rows=22 width=4) (actual time=277.737..509.802 rows=4 loops=3)

  • Filter: (("UserID" IS NOT NULL) AND ("Status" <> 3) AND ("UserID" <> 0))
  • Rows Removed by Filter: 734901
14. 2.968 4.488 ↑ 4.2 6 748

Hash Left Join (cost=1.80..2.47 rows=25 width=28) (actual time=0.001..0.006 rows=6 loops=748)

  • Hash Cond: (gs."ScopeID" = s."ID")
15. 1.496 1.496 ↑ 4.2 6 748

Index Scan using "IX_GroupScope_TaskAssignmentGroupID" on "GroupScope" gs (cost=0.14..0.74 rows=25 width=9) (actual time=0.001..0.002 rows=6 loops=748)

  • Index Cond: ("TaskAssignmentGroupID" = usr."TaskAssignmentGroupID")
16. 0.012 0.024 ↑ 1.0 29 1

Hash (cost=1.29..1.29 rows=29 width=23) (actual time=0.024..0.024 rows=29 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
17. 0.012 0.012 ↑ 1.0 29 1

Seq Scan on "Scope" s (cost=0.00..1.29 rows=29 width=23) (actual time=0.006..0.012 rows=29 loops=1)

18. 0.128 2.224 ↓ 10.9 175 1

Sort (cost=80.07..80.11 rows=16 width=4) (actual time=2.187..2.224 rows=175 loops=1)

  • Sort Key: ur."UserId
  • Sort Method: quicksort Memory: 31kB
19. 1.046 2.096 ↓ 9.3 149 1

Hash Join (cost=19.49..79.75 rows=16 width=4) (actual time=0.131..2.096 rows=149 loops=1)

  • Hash Cond: (ur."RoleId" = r."Id")
20. 0.967 0.967 ↑ 1.0 3,263 1

Seq Scan on "UserRoles" ur (cost=0.00..51.64 rows=3,264 width=8) (actual time=0.013..0.967 rows=3,263 loops=1)

21. 0.007 0.083 ↑ 3.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
22. 0.076 0.076 ↑ 3.0 1 1

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

  • Filter: (lower("Name") = 'agent'::text)
  • Rows Removed by Filter: 6
Planning time : 2.063 ms