explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aVuB

Settings
# exclusive inclusive rows x rows loops node
1. 0.025 58,575.769 ↓ 3.7 74 1

Limit (cost=1,400,187.01..1,400,187.06 rows=20 width=1,105) (actual time=58,575.727..58,575.769 rows=74 loops=1)

  • Buffers: shared hit=2934579
2. 0.297 58,575.744 ↓ 3.7 74 1

Sort (cost=1,400,187.01..1,400,187.06 rows=20 width=1,105) (actual time=58,575.727..58,575.744 rows=74 loops=1)

  • Sort Key: ((project0.name)::character varying(255)) COLLATE "en_US
  • Sort Method: quicksort Memory: 37kB
  • Buffers: shared hit=2934579
3. 0.495 58,575.447 ↓ 3.7 74 1

Nested Loop Left Join (cost=0.00..1,400,186.58 rows=20 width=1,105) (actual time=999.276..58,575.447 rows=74 loops=1)

  • Join Filter: (project0.programid = program6.id)
  • Buffers: shared hit=2934579
4. 0.170 11,363.618 ↓ 3.7 74 1

Nested Loop (cost=0.00..382,662.08 rows=20 width=73) (actual time=341.507..11,363.618 rows=74 loops=1)

  • Join Filter: (project0.projectstatuslabelid = projectstatuslabel7.id)
  • Rows Removed by Join Filter: 3
  • Buffers: shared hit=558564
5. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on projectstatuslabel projectstatuslabel7 (cost=0.00..1.07 rows=1 width=16) (actual time=0.005..0.007 rows=1 loops=1)

  • Filter: (projectstatustype = 1)
  • Rows Removed by Filter: 5
  • Buffers: shared hit=1
6. 0.397 11,363.441 ↓ 1.9 77 1

Seq Scan on project project0 (cost=0.00..382,660.49 rows=41 width=89) (actual time=193.652..11,363.441 rows=77 loops=1)

  • Filter: ((programid = 'faf506b2-6d9a-439e-93a4-7c3e8f495f6a'::uuid) AND ((alternatives: SubPlan 4 or hashed SubPlan 6) OR (istimeentryallowed AND (alternatives: SubPlan 8 or hashed SubPlan 10))))
  • Rows Removed by Filter: 132
  • Buffers: shared hit=558563
7.          

SubPlan (forSeq Scan)

8. 19.816 11,363.044 ↑ 29.0 1 79

Nested Loop Semi Join (cost=73.39..50,876.07 rows=29 width=0) (actual time=143.836..143.836 rows=1 loops=79)

  • Buffers: shared hit=558557
9. 10.428 10.428 ↑ 2.1 120 79

Index Scan using ixtkprojectid on task task8 (cost=0.29..90.59 rows=254 width=4) (actual time=0.010..0.132 rows=120 loops=79)

  • Index Cond: (projectid = project0.id)
  • Filter: (istimeentryallowed AND (NOT isclosed) AND (timeentrystartdate <= '2018-11-30'::date) AND (timeentryenddate >= '2018-11-16'::date))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=799
10. 928.803 11,332.800 ↓ 0.0 0 9,444

Hash Join (cost=73.10..260.30 rows=3,712 width=4) (actual time=1.200..1.200 rows=0 loops=9,444)

  • Hash Cond: (projectteammember9.id = taskteammemberassignment10.projectteammemberid)
  • Buffers: shared hit=557758
11. 10,356.766 10,356.777 ↑ 9.8 379 9,441

Seq Scan on projectteammember projectteammember9 (cost=4.53..170.75 rows=3,712 width=16) (actual time=0.002..1.097 rows=379 loops=9,441)

  • Filter: ((userid = 965) OR (hashed SubPlan 3))
  • Rows Removed by Filter: 6984
  • Buffers: shared hit=515679
12.          

SubPlan (forSeq Scan)

13. 0.003 0.011 ↑ 1.5 2 1

Nested Loop (cost=0.42..4.52 rows=3 width=4) (actual time=0.009..0.011 rows=2 loops=1)

  • Buffers: shared hit=5
14. 0.004 0.004 ↑ 1.0 1 1

Index Scan using ixduuserid on departmentusers departmentusers12 (cost=0.28..2.29 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (userid = 965)
  • Buffers: shared hit=3
15. 0.004 0.004 ↑ 1.5 2 1

Index Scan using ixdfhchildid on departmentflathierarchy departmentflathierarchy11 (cost=0.14..2.19 rows=3 width=8) (actual time=0.003..0.004 rows=2 loops=1)

  • Index Cond: (childid = departmentusers12.departmentid)
  • Buffers: shared hit=2
16. 9.444 47.220 ↑ 241.5 2 9,444

Hash (cost=62.54..62.54 rows=483 width=20) (actual time=0.005..0.005 rows=2 loops=9,444)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=42079
17. 37.776 37.776 ↑ 241.5 2 9,444

Index Only Scan using uix2projectteammembertaskassignment on taskteammemberassignment taskteammemberassignment10 (cost=0.43..62.54 rows=483 width=20) (actual time=0.003..0.004 rows=2 loops=9,444)

  • Index Cond: (taskid = task8.id)
  • Heap Fetches: 14187
  • Buffers: shared hit=42079
18. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=86,104.89..87,819.59 rows=6,096 width=4) (never executed)

  • Hash Cond: (task8_1.id = taskteammemberassignment10_1.taskid)
19. 0.000 0.000 ↓ 0.0 0

Seq Scan on task task8_1 (cost=0.00..1,456.55 rows=52,583 width=8) (never executed)

  • Filter: (istimeentryallowed AND (NOT isclosed) AND (timeentrystartdate <= '2018-11-30'::date) AND (timeentryenddate >= '2018-11-16'::date))
20. 0.000 0.000 ↓ 0.0 0

Hash (cost=86,026.58..86,026.58 rows=6,265 width=4) (never executed)

21. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=85,963.93..86,026.58 rows=6,265 width=4) (never executed)

  • Group Key: taskteammemberassignment10_1.taskid
22. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=217.15..82,177.41 rows=1,514,607 width=4) (never executed)

  • Hash Cond: (taskteammemberassignment10_1.projectteammemberid = projectteammember9_1.id)
23. 0.000 0.000 ↓ 0.0 0

Seq Scan on taskteammemberassignment taskteammemberassignment10_1 (cost=0.00..55,468.41 rows=3,025,541 width=20) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Hash (cost=170.75..170.75 rows=3,712 width=16) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Seq Scan on projectteammember projectteammember9_1 (cost=4.53..170.75 rows=3,712 width=16) (never executed)

  • Filter: ((userid = 965) OR (hashed SubPlan 5))
26.          

SubPlan (forSeq Scan)

27. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..4.52 rows=3 width=4) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Index Scan using ixduuserid on departmentusers departmentusers12_1 (cost=0.28..2.29 rows=1 width=4) (never executed)

  • Index Cond: (userid = 965)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using ixdfhchildid on departmentflathierarchy departmentflathierarchy11_1 (cost=0.14..2.19 rows=3 width=8) (never executed)

  • Index Cond: (childid = departmentusers12_1.departmentid)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using uix3ptm_projectrole on projectteammember projectteammember13 (cost=4.81..20.26 rows=18 width=0) (never executed)

  • Index Cond: (projectid = project0.id)
  • Filter: ((userid = 965) OR (hashed SubPlan 7))
31.          

SubPlan (forIndex Scan)

32. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..4.52 rows=3 width=4) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Index Scan using ixduuserid on departmentusers departmentusers15 (cost=0.28..2.29 rows=1 width=4) (never executed)

  • Index Cond: (userid = 965)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using ixdfhchildid on departmentflathierarchy departmentflathierarchy14 (cost=0.14..2.19 rows=3 width=8) (never executed)

  • Index Cond: (childid = departmentusers15.departmentid)
35. 0.000 0.000 ↓ 0.0 0

Seq Scan on projectteammember projectteammember13_1 (cost=4.53..170.75 rows=3,712 width=4) (never executed)

  • Filter: ((userid = 965) OR (hashed SubPlan 9))
36.          

SubPlan (forSeq Scan)

37. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..4.52 rows=3 width=4) (never executed)

38. 0.000 0.000 ↓ 0.0 0

Index Scan using ixduuserid on departmentusers departmentusers15_1 (cost=0.28..2.29 rows=1 width=4) (never executed)

  • Index Cond: (userid = 965)
39. 0.000 0.000 ↓ 0.0 0

Index Scan using ixdfhchildid on departmentflathierarchy departmentflathierarchy14_1 (cost=0.14..2.19 rows=3 width=8) (never executed)

  • Index Cond: (childid = departmentusers15_1.departmentid)
40. 0.139 0.148 ↑ 1.0 1 74

Materialize (cost=0.00..1.14 rows=1 width=1,048) (actual time=0.001..0.002 rows=1 loops=74)

  • Buffers: shared hit=1
41. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on program program6 (cost=0.00..1.14 rows=1 width=1,048) (actual time=0.007..0.009 rows=1 loops=1)

  • Filter: (id = 'faf506b2-6d9a-439e-93a4-7c3e8f495f6a'::uuid)
  • Rows Removed by Filter: 10
  • Buffers: shared hit=1
42.          

SubPlan (forNested Loop Left Join)

43. 0.814 47,211.186 ↑ 1.0 1 74

Aggregate (cost=50,876.14..50,876.15 rows=1 width=0) (actual time=637.989..637.989 rows=1 loops=74)

  • Buffers: shared hit=2376014
44. 45.738 47,210.372 ↑ 1.9 15 74

Nested Loop Semi Join (cost=73.39..50,876.07 rows=29 width=0) (actual time=144.881..637.978 rows=15 loops=74)

  • Buffers: shared hit=2376014
45. 40.922 40.922 ↓ 2.2 553 74

Index Scan using ixtkprojectid on task task1 (cost=0.29..90.59 rows=254 width=4) (actual time=0.008..0.553 rows=553 loops=74)

  • Index Cond: (projectid = project0.id)
  • Filter: (istimeentryallowed AND (NOT isclosed) AND (timeentrystartdate <= '2018-11-30'::date) AND (timeentryenddate >= '2018-11-16'::date))
  • Rows Removed by Filter: 3
  • Buffers: shared hit=3225
46. 3,952.200 47,123.712 ↓ 0.0 0 40,906

Hash Join (cost=73.10..260.30 rows=3,712 width=4) (actual time=1.152..1.152 rows=0 loops=40,906)

  • Hash Cond: (projectteammember2.id = taskteammemberassignment3.projectteammemberid)
  • Buffers: shared hit=2372789
47. 42,966.967 42,966.982 ↑ 9.9 376 40,882

Seq Scan on projectteammember projectteammember2 (cost=4.53..170.75 rows=3,712 width=16) (actual time=0.002..1.051 rows=376 loops=40,882)

  • Filter: ((userid = 965) OR (hashed SubPlan 1))
  • Rows Removed by Filter: 6869
  • Buffers: shared hit=2197374
48.          

SubPlan (forSeq Scan)

49. 0.006 0.015 ↑ 1.5 2 1

Nested Loop (cost=0.42..4.52 rows=3 width=4) (actual time=0.012..0.015 rows=2 loops=1)

  • Buffers: shared hit=5
50. 0.005 0.005 ↑ 1.0 1 1

Index Scan using ixduuserid on departmentusers departmentusers5 (cost=0.28..2.29 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (userid = 965)
  • Buffers: shared hit=3
51. 0.004 0.004 ↑ 1.5 2 1

Index Scan using ixdfhchildid on departmentflathierarchy departmentflathierarchy4 (cost=0.14..2.19 rows=3 width=8) (actual time=0.003..0.004 rows=2 loops=1)

  • Index Cond: (childid = departmentusers5.departmentid)
  • Buffers: shared hit=2
52. 81.812 204.530 ↑ 483.0 1 40,906

Hash (cost=62.54..62.54 rows=483 width=20) (actual time=0.005..0.005 rows=1 loops=40,906)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=175415
53. 122.718 122.718 ↑ 483.0 1 40,906

Index Only Scan using uix2projectteammembertaskassignment on taskteammemberassignment taskteammemberassignment3 (cost=0.43..62.54 rows=483 width=20) (actual time=0.003..0.003 rows=1 loops=40,906)

  • Index Cond: (taskid = task1.id)
  • Heap Fetches: 56923
  • Buffers: shared hit=175415