explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CmCJW : modified query + timeentry.entrydate + timeentrymetadata.upper(key) (explain only, killed after 2 mimutes)

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

Sort (cost=1,682,652.34..1,684,477.57 rows=730,094 width=408) (actual rows= loops=)

  • Sort Key: ((pj.code)::character varying(50)) COLLATE "en_US", ((pj.name)::character varying(255)) COLLATE "en_US", ((cl.name)::character varying(255)) COLLATE "en_US", ((tk.name)::character varying(255)) COLLATE "en_US", ((tk.code)::character varying(50)) 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", ((ui.externalid)::character varying(255)) COLLATE "en_US", ((ui.info5)::character varying(255)) COLLATE "en_US", ((dep.name)::character varying(255)) COLLATE "en_US", "*SELECT* 1".entrydate, ts.startdate, ts.enddate, tslist.timesheetstatus, ((tdh.hierarchysorting)::text) COLLATE "en_US", ((tdh.hierarchytaskname)::text) COLLATE "en_US", ((timeentrymetadata9.text)::text) COLLATE "en_US", ((userinfo10.displayname)::text) COLLATE "en_US", "*SELECT* 1".timeentryid, ((billingrate11.name)::character varying(50)) 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=1,237,045.81..1,342,034.48 rows=730,094 width=408) (actual rows= loops=)

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

Hash Left Join (cost=1,237,033.33..1,331,983.21 rows=730,094 width=399) (actual rows= loops=)

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

Hash Join (cost=1,236,992.97..1,321,922.49 rows=730,094 width=389) (actual rows= loops=)

  • Hash Cond: ("*SELECT* 1".userid = login.userid)
7. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,236,894.78..1,311,785.51 rows=730,094 width=371) (actual rows= loops=)

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

Merge Left Join (cost=1,231,487.27..1,235,515.21 rows=730,094 width=312) (actual rows= loops=)

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

Sort (cost=1,153,872.46..1,155,697.69 rows=730,094 width=268) (actual rows= loops=)

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

Hash Join (cost=831,011.93..898,102.62 rows=730,094 width=268) (actual rows= loops=)

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

Hash Left Join (cost=830,971.56..888,023.46 rows=730,094 width=229) (actual rows= loops=)

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

Hash Left Join (cost=830,969.08..882,873.81 rows=730,094 width=221) (actual rows= loops=)

  • Hash Cond: (task15.id = tk.id)
13. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=824,821.87..828,849.81 rows=730,094 width=180) (actual rows= loops=)

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

Sort (cost=746,859.79..748,685.02 rows=730,094 width=176) (actual rows= loops=)

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

Hash Left Join (cost=419,611.53..550,981.95 rows=730,094 width=176) (actual rows= loops=)

  • Hash Cond: (COALESCE(project13.id, task15.projectid) = pj.id)
16. 0.000 0.000 ↓ 0.0

Hash Join (cost=419,447.16..540,778.78 rows=730,094 width=100) (actual rows= loops=)

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

Nested Loop (cost=406,448.42..492,641.24 rows=731,965 width=112) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=406,448.00..407,123.25 rows=43,969 width=84) (actual rows= loops=)

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

Merge Left Join (cost=328,158.01..328,550.60 rows=43,969 width=80) (actual rows= loops=)

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

Sort (cost=244,953.02..245,062.95 rows=43,969 width=72) (actual rows= loops=)

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

Append (cost=38.80..239,756.09 rows=43,969 width=72) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=38.80..239,748.50 rows=43,952 width=72) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=38.80..239,308.98 rows=43,952 width=237) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=37.95..94,144.70 rows=1,625 width=237) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=37.52..49,342.37 rows=1,625 width=179) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Nested Loop (cost=37.08..4,564.41 rows=1,625 width=121) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

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

28. 0.000 0.000 ↓ 0.0

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

29. 0.000 0.000 ↓ 0.0

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

30. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on timeentry te (cost=37.08..4,546.13 rows=1,625 width=56) (actual rows= loops=)

  • Recheck Cond: ((entrydate >= '2019-03-30'::date) AND (entrydate <= '2019-04-05'::date))
  • Filter: ((timeallocationtype <> 2) OR (timeallocationtype IS NULL))
31. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ixtemp_teentrydate (cost=0.00..36.68 rows=1,625 width=0) (actual rows= loops=)

  • Index Cond: ((entrydate >= '2019-03-30'::date) AND (entrydate <= '2019-04-05'::date))
32. 0.000 0.000 ↓ 0.0

Index Scan using ixtemtimeentryid on timeentrymetadata tembillingrate (cost=0.43..27.55 rows=1 width=74) (actual rows= loops=)

  • Index Cond: (timeentryid = te.id)
  • Filter: (key = 'urn:replicon:time-entry-metadata-key:billing-rate'::text)
33. 0.000 0.000 ↓ 0.0

Index Scan using ixtemtimeentryid on timeentrymetadata temdbreaktype (cost=0.43..27.56 rows=1 width=74) (actual rows= loops=)

  • Index Cond: (timeentryid = te.id)
  • Filter: (upper(key) = 'URN:REPLICON:TIME-ENTRY-METADATA-KEY:BREAK-TYPE'::text)
34. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.85..87.80 rows=18 width=12) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Index Scan using uix2tsuseridstartdate on timesheet ts_1 (cost=0.42..5.83 rows=17 width=28) (actual rows= loops=)

  • Index Cond: ((userid = te.userid) AND (te.entrydate >= startdate))
  • Filter: (te.entrydate <= enddate)
36. 0.000 0.000 ↓ 0.0

Index Scan using ixtpsstimesheetid on timesheetpolicysettingssnapshot tspolicy (cost=0.43..4.80 rows=2 width=16) (actual rows= loops=)

  • Index Cond: (timesheetid = ts_1.id)
  • Filter: (upper(uri) = 'URN:REPLICON:POLICY:TIMESHEET:TIMESHEET-FORMAT:GEN4-TIMESHEET'::text)
37. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=0.42..7.59 rows=17 width=72) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.42..7.42 rows=17 width=24) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..2.04 rows=1 width=24) (actual rows= loops=)

  • Join Filter: (toe.timeoffid = toff.id)
40. 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 >= '2019-03-30'::date) AND (entrydate <= '2019-04-05'::date))
41. 0.000 0.000 ↓ 0.0

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

42. 0.000 0.000 ↓ 0.0

Index Only Scan using ixtsuseridstartdateenddate on timesheet ts_2 (cost=0.42..5.21 rows=17 width=12) (actual rows= loops=)

  • Index Cond: ((userid = toff.userid) AND (startdate <= toe.entrydate) AND (enddate >= toe.entrydate))
43. 0.000 0.000 ↓ 0.0

Sort (cost=83,204.99..83,284.80 rows=31,924 width=24) (actual rows= loops=)

  • Sort Key: timeentrymetadata14.timeentryid
44. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=5,220.47..80,816.70 rows=31,924 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on timeentrymetadata timeentrymetadata14 (cost=1,339.97..75,226.52 rows=31,924 width=74) (actual rows= loops=)

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

Bitmap Index Scan on istemp_temdkey (cost=0.00..1,331.99 rows=31,924 width=0) (actual rows= loops=)

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

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

48. 0.000 0.000 ↓ 0.0

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

49. 0.000 0.000 ↓ 0.0

Sort (cost=78,289.99..78,369.80 rows=31,924 width=20) (actual rows= loops=)

  • Sort Key: timeentrymetadata12.timeentryid
50. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,456.48..75,901.70 rows=31,924 width=20) (actual rows= loops=)

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

Bitmap Heap Scan on timeentrymetadata timeentrymetadata12 (cost=1,339.97..75,226.52 rows=31,924 width=74) (actual rows= loops=)

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

Bitmap Index Scan on istemp_temdkey (cost=0.00..1,331.99 rows=31,924 width=0) (actual rows= loops=)

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

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

54. 0.000 0.000 ↓ 0.0

Index Only Scan using project_pkey on project project13 (cost=0.28..81.86 rows=2,772 width=4) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

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

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

Hash (cost=10,526.64..10,526.64 rows=134,648 width=20) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

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

  • Filter: (timesheetstatus = ANY ('{0,1,2,3,4}'::integer[]))
58. 0.000 0.000 ↓ 0.0

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

59. 0.000 0.000 ↓ 0.0

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

60. 0.000 0.000 ↓ 0.0

Sort (cost=77,962.08..78,041.89 rows=31,924 width=20) (actual rows= loops=)

  • Sort Key: timeentrymetadata16.timeentryid
61. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,342.45..75,573.79 rows=31,924 width=20) (actual rows= loops=)

  • Hash Cond: (("substring"(timeentrymetadata16.uri, '^urn:replicon-tenant:d39c603ba5ee46da9a42069eec872cf2:client:(.*)$'::text))::integer = clients17.id)
62. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on timeentrymetadata timeentrymetadata16 (cost=1,339.97..75,226.52 rows=31,924 width=74) (actual rows= loops=)

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

Bitmap Index Scan on istemp_temdkey (cost=0.00..1,331.99 rows=31,924 width=0) (actual rows= loops=)

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

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

65. 0.000 0.000 ↓ 0.0

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

66. 0.000 0.000 ↓ 0.0

Hash (cost=4,301.60..4,301.60 rows=86,689 width=45) (actual rows= loops=)

67. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2.44..4,301.60 rows=86,689 width=45) (actual rows= loops=)

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

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

69. 0.000 0.000 ↓ 0.0

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

70. 0.000 0.000 ↓ 0.0

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

  • Filter: ((variablecurrencyid = $0) AND (('now'::cstring)::date >= effectivedate) AND (('now'::cstring)::date <= enddate))
71. 0.000 0.000 ↓ 0.0

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

72. 0.000 0.000 ↓ 0.0

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

73. 0.000 0.000 ↓ 0.0

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

74. 0.000 0.000 ↓ 0.0

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

75. 0.000 0.000 ↓ 0.0

Sort (cost=77,614.81..77,694.62 rows=31,924 width=60) (actual rows= loops=)

  • Sort Key: timeentrymetadata9.timeentryid
76. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on timeentrymetadata timeentrymetadata9 (cost=1,339.97..75,226.52 rows=31,924 width=60) (actual rows= loops=)

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

Bitmap Index Scan on istemp_temdkey (cost=0.00..1,331.99 rows=31,924 width=0) (actual rows= loops=)

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

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

79. 0.000 0.000 ↓ 0.0

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

80. 0.000 0.000 ↓ 0.0

Hash (cost=85.76..85.76 rows=994 width=30) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Hash Join (cost=30.49..85.76 rows=994 width=30) (actual rows= loops=)

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

Hash Join (cost=28.37..69.97 rows=994 width=20) (actual rows= loops=)

  • Hash Cond: (login.userid = du.userid)
83. 0.000 0.000 ↓ 0.0

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

84. 0.000 0.000 ↓ 0.0

Hash (cost=15.94..15.94 rows=994 width=8) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

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

86. 0.000 0.000 ↓ 0.0

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

87. 0.000 0.000 ↓ 0.0

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

88. 0.000 0.000 ↓ 0.0

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

89. 0.000 0.000 ↓ 0.0

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

90. 0.000 0.000 ↓ 0.0

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

91. 0.000 0.000 ↓ 0.0

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