explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pwgV

Settings
# exclusive inclusive rows x rows loops node
1. 644.219 12,922.172 ↓ 7.1 120 1

Subquery Scan on membershipPermissions (cost=113,893.94..155,360.12 rows=17 width=64) (actual time=5,730.305..12,922.172 rows=120 loops=1)

  • Rows Removed by Filter: 731989
  • Filter: (("membershipPermissions"."userId" = 1) AND ("membershipPermissions"."entityType" = 'WORKFLOW'::"MEMBERSHIP_TYPE"))
2. 2,012.577 12,277.953 ↓ 1.1 732,109 1

WindowAgg (cost=113,893.94..144,993.58 rows=691,103 width=65) (actual time=5,730.298..12,277.953 rows=732,109 loops=1)

3. 1,348.570 10,265.376 ↓ 1.1 732,109 1

Subquery Scan on a (cost=113,893.94..132,899.27 rows=691,103 width=61) (actual time=5,730.283..10,265.376 rows=732,109 loops=1)

4. 1,516.187 8,916.806 ↓ 1.1 732,109 1

Unique (cost=113,893.94..125,988.24 rows=691,103 width=60) (actual time=5,730.275..8,916.806 rows=732,109 loops=1)

5. 4,158.187 7,400.619 ↓ 1.1 732,172 1

Sort (cost=113,893.94..115,621.70 rows=691,103 width=60) (actual time=5,730.270..7,400.619 rows=732,172 loops=1)

  • Sort Method: external merge Disk: 49408kB
  • Sort Key: umr."entityId", umr."userId", umr."createdOn", perm.permission, umr."lastModified", umr."entityType
6. 1,150.481 3,242.432 ↓ 1.1 732,172 1

Append (cost=1.58..20,877.99 rows=691,103 width=60) (actual time=0.217..3,242.432 rows=732,172 loops=1)

7. 2,089.834 2,089.834 ↓ 1.1 731,290 1

Merge Join (cost=2,766.76..10,494.53 rows=690,668 width=54) (actual time=75.175..2,089.834 rows=731,290 loops=1)

8. 0.000 2.117 ↓ 2.0 882 1

Hash Join (cost=1.58..16.92 rows=435 width=54) (actual time=0.215..2.117 rows=882 loops=1)

  • Merge Cond: (ugmr."groupId" = ugm."groupId")
  • Hash Cond: (perm."roleId" = umr."roleId")
9. 57.269 57.269 ↓ 1.0 9,788 1

Sort (cost=914.12..938.22 rows=9,639 width=54) (actual time=47.735..57.269 rows=9,788 loops=1)

10. 647.133 647.133 ↓ 158.9 731,107 1

Sort (cost=503.49..515.00 rows=4,602 width=8) (actual time=27.427..647.133 rows=731,107 loops=1)

11. 0.426 0.426 ↑ 1.0 435 1

Seq Scan on "rolesPerms" perm (cost=0.00..9.35 rows=435 width=30) (actual time=0.012..0.426 rows=435 loops=1)

12. 0.000 0.189 ↑ 1.0 26 1

Hash (cost=1.26..1.26 rows=26 width=32) (actual time=0.188..0.189 rows=26 loops=1)

  • Sort Method: quicksort Memory: 1750kB
  • Sort Method: quicksort Memory: 408kB
  • Sort Key: ugmr."groupId
  • Sort Key: ugm."groupId
  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
13. 0.147 0.147 ↑ 1.0 26 1

Seq Scan on "userMembershipRoles" umr (cost=0.00..1.26 rows=26 width=32) (actual time=0.009..0.147 rows=26 loops=1)

14. 33.861 33.861 ↓ 1.0 9,788 1

Merge Join (cost=129.52..276.28 rows=9,639 width=54) (actual time=4.276..33.861 rows=9,788 loops=1)

15. 0.000 22.592 ↑ 1.0 4,602 1

Hash Join (cost=135.39..223.50 rows=4,602 width=8) (actual time=8.578..22.592 rows=4,602 loops=1)

  • Merge Cond: (perm_1."roleId" = ugmr."roleId")
  • Hash Cond: (ugm."userId" = u.id)
16. 11.558 11.558 ↓ 6.9 9,788 1

Sort (cost=101.11..104.68 rows=1,428 width=32) (actual time=3.303..11.558 rows=9,788 loops=1)

17. 1.330 1.330 ↑ 1.0 435 1

Sort (cost=28.41..29.50 rows=435 width=30) (actual time=0.964..1.330 rows=435 loops=1)

18. 4.298 4.298 ↑ 1.0 4,602 1

Seq Scan on "userGroupMapping" ugm (cost=0.00..76.02 rows=4,602 width=8) (actual time=0.027..4.298 rows=4,602 loops=1)

19. 2.587 8.526 ↑ 1.0 3,573 1

Hash (cost=90.73..90.73 rows=3,573 width=4) (actual time=8.525..8.526 rows=3,573 loops=1)

  • Sort Method: quicksort Memory: 160kB
  • Sort Method: quicksort Memory: 59kB
  • Sort Key: ugmr."roleId
  • Sort Key: perm_1."roleId
  • Buckets: 4096 Batches: 1 Memory Usage: 158kB
20. 3.856 3.856 ↑ 1.0 3,573 1

Seq Scan on users u (cost=0.00..90.73 rows=3,573 width=4) (actual time=0.011..3.856 rows=3,573 loops=1)

21. 1.626 1.626 ↑ 1.0 1,428 1

Seq Scan on "userGroupMembershipRoles" ugmr (cost=0.00..26.28 rows=1,428 width=32) (actual time=0.012..1.626 rows=1,428 loops=1)

22. 0.457 0.457 ↑ 1.0 435 1

Seq Scan on "rolesPerms" perm_1 (cost=0.00..9.35 rows=435 width=30) (actual time=0.008..0.457 rows=435 loops=1)

Planning time : 1.332 ms
Execution time : 12,933.435 ms