explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ObhK : Optimization for: Optimization for: plan #H4AZ; plan #qeuJ

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 255.009 271.517 ↓ 10.2 918,964 1

Hash Join (cost=164.18..2,267.88 rows=90,066 width=645) (actual time=9.403..271.517 rows=918,964 loops=1)

  • Hash Cond: (asnusr."RoleId" = rol."Id")
2. 5.314 8.257 ↓ 11.6 33,602 1

Hash Join (cost=97.92..280.61 rows=2,887 width=72) (actual time=1.139..8.257 rows=33,602 loops=1)

  • Hash Cond: ((asnusr."SourceId")::text = (cli."Id")::text)
3. 1.279 2.430 ↑ 1.0 2,745 1

Hash Join (cost=45.85..182.38 rows=2,766 width=109) (actual time=0.612..2.430 rows=2,745 loops=1)

  • Hash Cond: (asnusr."UserId" = usr."Id")
4. 0.560 0.560 ↑ 1.0 2,745 1

Seq Scan on "AspNetUserRoles" asnusr (cost=0.00..101.66 rows=2,766 width=111) (actual time=0.008..0.560 rows=2,745 loops=1)

5. 0.135 0.591 ↓ 1.0 572 1

Hash (cost=38.71..38.71 rows=571 width=72) (actual time=0.591..0.591 rows=572 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 67kB
6. 0.456 0.456 ↓ 1.0 572 1

Seq Scan on "AspNetUsers" usr (cost=0.00..38.71 rows=571 width=72) (actual time=0.004..0.456 rows=572 loops=1)

7. 0.083 0.513 ↑ 1.0 406 1

Hash (cost=46.99..46.99 rows=406 width=74) (actual time=0.513..0.513 rows=406 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 51kB
8. 0.148 0.430 ↑ 1.0 406 1

Hash Join (cost=6.83..46.99 rows=406 width=74) (actual time=0.060..0.430 rows=406 loops=1)

  • Hash Cond: ((pro."ClientId")::text = (cli."Id")::text)
9. 0.238 0.238 ↑ 1.0 406 1

Seq Scan on "Project" pro (cost=0.00..35.06 rows=406 width=37) (actual time=0.005..0.238 rows=406 loops=1)

10. 0.022 0.044 ↓ 1.0 127 1

Hash (cost=5.26..5.26 rows=126 width=37) (actual time=0.044..0.044 rows=127 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
11. 0.022 0.022 ↓ 1.0 127 1

Seq Scan on "Client" cli (cost=0.00..5.26 rows=126 width=37) (actual time=0.004..0.022 rows=127 loops=1)

12. 0.391 8.251 ↓ 1.5 1,055 1

Hash (cost=57.29..57.29 rows=718 width=632) (actual time=8.251..8.251 rows=1,055 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 196kB
13. 0.290 7.860 ↓ 1.5 1,055 1

Hash Join (cost=18.90..57.29 rows=718 width=632) (actual time=2.357..7.860 rows=1,055 loops=1)

  • Hash Cond: ((prol."PermissionId")::text = (perm."Id")::text)
14. 3.265 5.944 ↑ 1.0 585 1

Hash Join (cost=1.52..30.53 rows=585 width=623) (actual time=0.715..5.944 rows=585 loops=1)

  • Hash Cond: ((prol."RoleId")::text = rol."Id")
15. 2.142 2.142 ↑ 1.0 585 1

Seq Scan on "PermissionRole" prol (cost=0.00..21.85 rows=585 width=74) (actual time=0.008..2.142 rows=585 loops=1)

16. 0.011 0.537 ↑ 1.0 23 1

Hash (cost=1.23..1.23 rows=23 width=549) (actual time=0.537..0.537 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
17. 0.526 0.526 ↑ 1.0 23 1

Seq Scan on "AspNetRoles" rol (cost=0.00..1.23 rows=23 width=549) (actual time=0.522..0.526 rows=23 loops=1)

18. 0.055 1.626 ↓ 1.0 164 1

Hash (cost=15.42..15.42 rows=157 width=120) (actual time=1.626..1.626 rows=164 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 33kB
19. 0.642 1.571 ↓ 1.0 164 1

Hash Join (cost=6.88..15.42 rows=157 width=120) (actual time=0.362..1.571 rows=164 loops=1)

  • Hash Cond: ((res."PermissionId")::text = (perm."Id")::text)
20. 0.879 0.879 ↓ 1.0 164 1

Seq Scan on "Resource" res (cost=0.00..6.57 rows=157 width=63) (actual time=0.150..0.879 rows=164 loops=1)

21. 0.023 0.050 ↑ 1.3 102 1

Hash (cost=5.28..5.28 rows=128 width=57) (actual time=0.050..0.050 rows=102 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
22. 0.027 0.027 ↑ 1.3 102 1

Seq Scan on "Permission" perm (cost=0.00..5.28 rows=128 width=57) (actual time=0.005..0.027 rows=102 loops=1)

Planning time : 8.762 ms