explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VyYq

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=73,577,897.36..73,593,390.98 rows=6,197,446 width=4,045) (actual rows= loops=)

  • Sort Key: ((pj.code)::character varying(50)) COLLATE "en_US", ((pj.name)::character varying(255)) COLLATE "en_US", ((tk.name)::character varying(255)) COLLATE "en_US", ((tk.code)::character varying(50)) COLLATE "en_US", ((ui.externalid)::character varying(255)) COLLATE "en_US", ((ui.lastname)::character varying(50)) COLLATE "en_US", ((ui.firstname)::character varying(50)) COLLATE "en_US", ui.duplicatename, ((login.loginname)::character varying(255)) COLLATE "en_US", ((dep.name)::character varying(255)) COLLATE "en_US", "*SELECT* 1".timeentryid, "*SELECT* 1".entrydate, ts.enddate, ((timeentrymetadata7.text)::text) COLLATE "en_US", ((cl.name)::character varying(255)) COLLATE "en_US", ((cl.code)::character varying(50)) COLLATE "en_US", ((userinfo9.displayname)::text) COLLATE "en_US", ((userinfo10.displayname)::text) COLLATE "en_US", ((billingrate11.name)::character varying(50)) COLLATE "en_US", ((tdh.hierarchysorting)::text) COLLATE "en_US", ((tdh.hierarchytaskname)::text) COLLATE "en_US
2.          

Initplan (forSort)

3. 0.000 0.000 ↓ 0.0

Seq Scan on systeminformation (cost=0.00..1.01 rows=1 width=4) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24,489,939.50..29,750,785.97 rows=6,197,446 width=4,045) (actual rows= loops=)

  • Hash Cond: ("*SELECT* 1".billingrateid = billingrate11.id)
5. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24,489,927.02..29,734,322.31 rows=6,197,446 width=370) (actual rows= loops=)

  • Hash Cond: (pj.projectleaderapproverid = userinfo10.id)
6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24,489,886.65..29,717,944.46 rows=6,197,446 width=360) (actual rows= loops=)

  • Hash Cond: (cl.clientmanageruserid = userinfo9.id)
7. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24,489,846.29..29,701,635.80 rows=6,197,446 width=350) (actual rows= loops=)

  • Hash Cond: (COALESCE(clients18.id, pj.clientid) = cl.id)
8. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24,489,843.80..29,685,020.29 rows=6,197,446 width=335) (actual rows= loops=)

  • Hash Cond: (tk.id = tdh.taskid)
9. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24,484,436.30..29,202,443.70 rows=6,197,446 width=275) (actual rows= loops=)

  • Hash Cond: (CASE WHEN ("substring"(timeentrymetadata17.uri, '^urn:replicon-tenant:d39c603ba5ee46da9a42069eec872cf2:client:(.*)$'::text) ~ '^\s*[-]?[0-9]+\s*$'::text) THEN ("substring"(timeentrymetadata17.uri, '^urn:replicon-tenant:d39c603ba5ee46da9a42069eec872cf2:client:(.*)$'::text))::integer ELSE NULL::integer END = clients18.id)
10. 0.000 0.000 ↓ 0.0

Hash Join (cost=24,484,433.81..29,181,780.49 rows=6,197,446 width=328) (actual rows= loops=)

  • Hash Cond: (pj.id = project19.id)
11. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24,484,292.33..29,064,934.44 rows=44,391,009 width=328) (actual rows= loops=)

  • Hash Cond: ("*SELECT* 1".timeentryid = timeentrymetadata17.timeentryid)
12. 0.000 0.000 ↓ 0.0

Hash Join (cost=24,315,557.52..28,729,732.93 rows=44,391,009 width=271) (actual rows= loops=)

  • Hash Cond: ("*SELECT* 1".userid = ui.id)
13. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=24,315,438.23..28,119,237.27 rows=44,391,009 width=227) (actual rows= loops=)

  • Hash Cond: (task16.id = tk.id)
14. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=24,309,460.31..24,987,953.98 rows=44,391,009 width=202) (actual rows= loops=)

  • Merge Cond: ("*SELECT* 1".timeentryid = timeentrymetadata7.timeentryid)
15. 0.000 0.000 ↓ 0.0

Sort (cost=23,961,550.04..24,072,527.56 rows=44,391,009 width=156) (actual rows= loops=)

  • Sort Key: "*SELECT* 1".timeentryid
16. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,817,637.35..7,853,884.42 rows=44,391,009 width=156) (actual rows= loops=)

  • Hash Cond: (COALESCE(task16.projectid, project14.id) = pj.id)
17. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,817,472.98..7,737,015.50 rows=44,391,009 width=96) (actual rows= loops=)

  • Hash Cond: (ts.id = tslist.timesheetid)
18. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=1,804,979.09..6,129,560.99 rows=44,494,836 width=108) (actual rows= loops=)

  • Merge Cond: (timeentrymetadata15.timeentryid = "*SELECT* 1".timeentryid)
19. 0.000 0.000 ↓ 0.0

Sort (cost=473,154.58..476,728.16 rows=1,429,434 width=24) (actual rows= loops=)

  • Sort Key: timeentrymetadata15.timeentryid
20. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,880.50..268,384.30 rows=1,429,434 width=24) (actual rows= loops=)

  • Hash Cond: (("substring"(timeentrymetadata15.uri, '^urn:replicon-tenant:d39c603ba5ee46da9a42069eec872cf2:task:(.*)$'::text))::integer = task16.id)
21. 0.000 0.000 ↓ 0.0

Seq Scan on timeentrymetadata timeentrymetadata15 (cost=0.00..223,580.27 rows=1,429,434 width=73) (actual rows= loops=)

  • Filter: (upper(key) = 'URN:REPLICON:TIME-ENTRY-METADATA-KEY:TASK'::text)
22. 0.000 0.000 ↓ 0.0

Hash (cost=2,457.89..2,457.89 rows=86,689 width=8) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on task task16 (cost=0.00..2,457.89 rows=86,689 width=8) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Materialize (cost=1,331,824.52..5,063,969.07 rows=32,852,964 width=100) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,331,824.52..4,981,836.66 rows=32,852,964 width=100) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=1,331,824.10..1,372,379.51 rows=1,977,851 width=76) (actual rows= loops=)

  • Merge Cond: ("*SELECT* 1".timeentryid = timeentrymetadata13.timeentryid)
27. 0.000 0.000 ↓ 0.0

Sort (cost=899,728.75..903,391.63 rows=1,465,153 width=72) (actual rows= loops=)

  • Sort Key: "*SELECT* 1".timeentryid
28. 0.000 0.000 ↓ 0.0

Append (cost=231,880.61..629,487.89 rows=1,465,153 width=72) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=231,880.61..629,485.84 rows=1,465,152 width=72) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Nested Loop (cost=231,880.61..614,834.32 rows=1,465,152 width=132) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Seq Scan on projectsysteminformation psi (cost=0.00..1.01 rows=1 width=32) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Nested Loop (cost=231,880.61..526,924.19 rows=1,465,152 width=203) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Seq Scan on systeminformation si (cost=0.00..1.01 rows=1 width=33) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=231,880.61..512,271.66 rows=1,465,152 width=170) (actual rows= loops=)

  • Hash Cond: (te.id = temdbreaktype.timeentryid)
35. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=63,145.80..338,042.53 rows=1,465,152 width=113) (actual rows= loops=)

  • Hash Cond: (tembillingrate.timeentryid = te.id)
36. 0.000 0.000 ↓ 0.0

Seq Scan on timeentrymetadata tembillingrate (cost=0.00..223,580.27 rows=1,320,934 width=73) (actual rows= loops=)

  • Filter: (upper(key) = 'URN:REPLICON:TIME-ENTRY-METADATA-KEY:BILLING-RATE'::text)
37. 0.000 0.000 ↓ 0.0

Hash (cost=30,522.40..30,522.40 rows=1,465,152 width=56) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Seq Scan on timeentry te (cost=0.00..30,522.40 rows=1,465,152 width=56) (actual rows= loops=)

  • Filter: ((entrydate IS NOT NULL) AND ((timeallocationtype <> 2) OR (timeallocationtype IS NULL)))
39. 0.000 0.000 ↓ 0.0

Hash (cost=168,734.79..168,734.79 rows=1 width=73) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.00..168,734.79 rows=1 width=73) (actual rows= loops=)

  • Workers Planned: 2
41. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on timeentrymetadata temdbreaktype (cost=0.00..167,734.69 rows=1 width=73) (actual rows= loops=)

  • Filter: (upper(key) = 'URN:REPLICON:TIME-ENTRY-METADATA-KEY:BREAK-TYPE'::text)
42. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=0.00..2.04 rows=1 width=72) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..2.03 rows=1 width=132) (actual rows= loops=)

  • Join Filter: (toe.timeoffid = toff.id)
44. 0.000 0.000 ↓ 0.0

Seq Scan on timeoffentries toe (cost=0.00..1.01 rows=1 width=24) (actual rows= loops=)

  • Filter: (entrydate IS NOT NULL)
45. 0.000 0.000 ↓ 0.0

Seq Scan on timeoffs toff (cost=0.00..1.01 rows=1 width=8) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Materialize (cost=432,095.35..439,219.11 rows=1,424,753 width=20) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Sort (cost=432,095.35..435,657.23 rows=1,424,753 width=20) (actual rows= loops=)

  • Sort Key: timeentrymetadata13.timeentryid
48. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=164.37..228,026.35 rows=1,424,753 width=20) (actual rows= loops=)

  • Hash Cond: (("substring"(timeentrymetadata13.uri, '^urn:replicon-tenant:d39c603ba5ee46da9a42069eec872cf2:project:(.*)$'::text))::integer = project14.id)
49. 0.000 0.000 ↓ 0.0

Seq Scan on timeentrymetadata timeentrymetadata13 (cost=0.00..223,580.27 rows=1,424,753 width=73) (actual rows= loops=)

  • Filter: (upper(key) = 'URN:REPLICON:TIME-ENTRY-METADATA-KEY:PROJECT'::text)
50. 0.000 0.000 ↓ 0.0

Hash (cost=129.72..129.72 rows=2,772 width=4) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Seq Scan on project project14 (cost=0.00..129.72 rows=2,772 width=4) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Index Scan using ixtsuseridstartdateenddate on timesheet ts (cost=0.42..1.65 rows=17 width=28) (actual rows= loops=)

  • Index Cond: ((userid = "*SELECT* 1".userid) AND ("*SELECT* 1".entrydate >= startdate) AND ("*SELECT* 1".entrydate <= enddate))
53. 0.000 0.000 ↓ 0.0

Hash (cost=10,020.41..10,020.41 rows=134,678 width=20) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Seq Scan on dm_timesheetlist_facts tslist (cost=0.00..10,020.41 rows=134,678 width=20) (actual rows= loops=)

  • Filter: (timesheetstatus = 2)
55. 0.000 0.000 ↓ 0.0

Hash (cost=129.72..129.72 rows=2,772 width=68) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Seq Scan on project pj (cost=0.00..129.72 rows=2,772 width=68) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Materialize (cost=347,910.27..351,514.17 rows=720,780 width=62) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Sort (cost=347,910.27..349,712.22 rows=720,780 width=62) (actual rows= loops=)

  • Sort Key: timeentrymetadata7.timeentryid
59. 0.000 0.000 ↓ 0.0

Seq Scan on timeentrymetadata timeentrymetadata7 (cost=0.00..223,580.27 rows=720,780 width=62) (actual rows= loops=)

  • Filter: (upper(key) = 'URN:REPLICON:TIME-ENTRY-METADATA-KEY:COMMENTS'::text)
60. 0.000 0.000 ↓ 0.0

Hash (cost=4,301.30..4,301.30 rows=86,689 width=29) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2.19..4,301.30 rows=86,689 width=29) (actual rows= loops=)

  • Hash Cond: (tk.estimatedcostcurrencyid = exchangerate.fixedcurrencyid)
62. 0.000 0.000 ↓ 0.0

Seq Scan on task tk (cost=0.00..2,457.89 rows=86,689 width=33) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Hash (cost=2.10..2.10 rows=7 width=4) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

Seq Scan on exchangerate (cost=0.00..2.10 rows=7 width=4) (actual rows= loops=)

  • Filter: ((variablecurrencyid = $0) AND (CURRENT_DATE >= effectivedate) AND (CURRENT_DATE <= enddate))
65. 0.000 0.000 ↓ 0.0

Hash (cost=106.87..106.87 rows=994 width=56) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Hash Join (cost=82.85..106.87 rows=994 width=56) (actual rows= loops=)

  • Hash Cond: (du.departmentid = dep.id)
67. 0.000 0.000 ↓ 0.0

Hash Join (cost=80.73..101.91 rows=994 width=46) (actual rows= loops=)

  • Hash Cond: (ui.id = login.userid)
68. 0.000 0.000 ↓ 0.0

Hash Join (cost=40.36..58.93 rows=994 width=34) (actual rows= loops=)

  • Hash Cond: (du.userid = ui.id)
69. 0.000 0.000 ↓ 0.0

Seq Scan on departmentusers du (cost=0.00..15.94 rows=994 width=8) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Hash (cost=27.94..27.94 rows=994 width=26) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Seq Scan on userinfo ui (cost=0.00..27.94 rows=994 width=26) (actual rows= loops=)

72. 0.000 0.000 ↓ 0.0

Hash (cost=27.94..27.94 rows=994 width=12) (actual rows= loops=)

73. 0.000 0.000 ↓ 0.0

Seq Scan on login (cost=0.00..27.94 rows=994 width=12) (actual rows= loops=)

74. 0.000 0.000 ↓ 0.0

Hash (cost=1.50..1.50 rows=50 width=18) (actual rows= loops=)

75. 0.000 0.000 ↓ 0.0

Seq Scan on departments dep (cost=0.00..1.50 rows=50 width=18) (actual rows= loops=)

76. 0.000 0.000 ↓ 0.0

Hash (cost=168,734.79..168,734.79 rows=1 width=73) (actual rows= loops=)

77. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.00..168,734.79 rows=1 width=73) (actual rows= loops=)

  • Workers Planned: 2
78. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on timeentrymetadata timeentrymetadata17 (cost=0.00..167,734.69 rows=1 width=73) (actual rows= loops=)

  • Filter: (upper(key) = 'URN:REPLICON:TIME-ENTRY-METADATA-KEY:CLIENT'::text)
79. 0.000 0.000 ↓ 0.0

Hash (cost=136.65..136.65 rows=387 width=4) (actual rows= loops=)

80. 0.000 0.000 ↓ 0.0

Seq Scan on project project19 (cost=0.00..136.65 rows=387 width=4) (actual rows= loops=)

  • Filter: (projectstatuslabelid = 'f6918709-d5cf-436b-b0ff-2191cd2dd6a9'::uuid)
81. 0.000 0.000 ↓ 0.0

Hash (cost=1.66..1.66 rows=66 width=4) (actual rows= loops=)

82. 0.000 0.000 ↓ 0.0

Seq Scan on clients clients18 (cost=0.00..1.66 rows=66 width=4) (actual rows= loops=)

83. 0.000 0.000 ↓ 0.0

Hash (cost=3,391.89..3,391.89 rows=86,689 width=64) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Seq Scan on taskdenormalizedhierarchy tdh (cost=0.00..3,391.89 rows=86,689 width=64) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

Hash (cost=1.66..1.66 rows=66 width=23) (actual rows= loops=)

86. 0.000 0.000 ↓ 0.0

Seq Scan on clients cl (cost=0.00..1.66 rows=66 width=23) (actual rows= loops=)

87. 0.000 0.000 ↓ 0.0

Hash (cost=27.94..27.94 rows=994 width=18) (actual rows= loops=)

88. 0.000 0.000 ↓ 0.0

Seq Scan on userinfo userinfo9 (cost=0.00..27.94 rows=994 width=18) (actual rows= loops=)

89. 0.000 0.000 ↓ 0.0

Hash (cost=27.94..27.94 rows=994 width=18) (actual rows= loops=)

90. 0.000 0.000 ↓ 0.0

Seq Scan on userinfo userinfo10 (cost=0.00..27.94 rows=994 width=18) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

Hash (cost=7.77..7.77 rows=377 width=41) (actual rows= loops=)

92. 0.000 0.000 ↓ 0.0

Seq Scan on billingrate billingrate11 (cost=0.00..7.77 rows=377 width=41) (actual rows= loops=)