explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QAaq

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 549.778 ↓ 0.0 0 1

Unique (cost=505,261.78..505,262.53 rows=30 width=56) (actual time=549.778..549.778 rows=0 loops=1)

2. 1.515 549.777 ↓ 0.0 0 1

Sort (cost=505,261.78..505,261.86 rows=30 width=56) (actual time=549.777..549.777 rows=0 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: 25kB
3. 0.003 548.262 ↓ 0.0 0 1

Nested Loop (cost=503,851.06..505,261.04 rows=30 width=56) (actual time=548.262..548.262 rows=0 loops=1)

4. 0.008 0.024 ↑ 1.0 1 1

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

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

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

6. 0.012 0.012 ↓ 7.8 31 1

Bitmap Index Scan on "IX_Settings_Value" (cost=0.00..4.18 rows=4 width=0) (actual time=0.011..0.012 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.152 548.235 ↓ 0.0 0 1

Merge Join (cost=503,842.45..505,248.12 rows=30 width=56) (actual time=548.235..548.235 rows=0 loops=1)

  • Merge Cond: (usr."Id" = ur."UserId")
9. 2.833 543.993 ↓ 1.6 5,138 1

Nested Loop Left Join (cost=503,762.38..505,166.21 rows=3,194 width=56) (actual time=534.990..543.993 rows=5,138 loops=1)

10. 2.314 535.922 ↓ 2.1 873 1

Index Scan using "PK_ApplicationUser" on "ApplicationUser" usr (cost=503,760.58..504,771.61 rows=425 width=36) (actual time=534.350..535.922 rows=873 loops=1)

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

SubPlan (forIndex Scan)

12. 10.604 533.608 ↑ 2.9 12 1

Gather (cost=1,000.00..503,760.21 rows=35 width=4) (actual time=179.226..533.608 rows=12 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
13. 523.004 523.004 ↑ 3.8 4 3

Parallel Seq Scan on "Tasks" (cost=0.00..502,756.71 rows=15 width=4) (actual time=169.506..523.004 rows=4 loops=3)

  • Filter: (("UserID" IS NOT NULL) AND ("UserID" <> 0) AND ("Status" <> 3))
  • Rows Removed by Filter: 735132
14. 2.594 5.238 ↑ 5.0 5 873

Hash Left Join (cost=1.80..2.47 rows=25 width=28) (actual time=0.002..0.006 rows=5 loops=873)

  • Hash Cond: (gs."ScopeID" = s."ID")
15. 2.619 2.619 ↑ 5.0 5 873

Index Scan using "IX_GroupScope_TaskAssignmentGroupID" on "GroupScope" gs (cost=0.14..0.74 rows=25 width=9) (actual time=0.001..0.003 rows=5 loops=873)

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

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

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

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

18. 0.526 3.090 ↓ 9.4 150 1

Sort (cost=80.07..80.11 rows=16 width=4) (actual time=3.056..3.090 rows=150 loops=1)

  • Sort Key: ur."UserId
  • Sort Method: quicksort Memory: 32kB
19. 1.786 2.564 ↓ 9.6 154 1

Hash Join (cost=19.49..79.75 rows=16 width=4) (actual time=1.029..2.564 rows=154 loops=1)

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

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

21. 0.005 0.026 ↑ 3.0 1 1

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

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

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

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