More performant #147
-
I'm trying to roll up a date field to get the most recent date of all the child records. Specifically, it's bills (child) associated with a vendor (parent - account object). So I'm looking to store the last bill date on the accounts object. My question: Is it more performant to do a rollup operation of Max on a date field or a Last on a date field? The reason I'm asking is I'm getting some CPU timeout errors when trying to do a full recalc to do the initial populating of this field. I'm currently using Last with the order by. Does the ASC vs DESC get set automatically based on the First vs Last? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I created a new Rollup Control and set it to Batchable instead of Queuable. Seems to be working better. Does this make sense to do for the initial populating and then switch it back when running in "maintenance mode"? |
Beta Was this translation helpful? Give feedback.
-
My suggested answer (going through Discussions for the first time in a while) - There should be no discernable performance difference between a MAX of a date field versus using LAST with an Order By on the same field. While the underlying mechanism producing the result between the two differs, the end result in terms of time should be nigh-indistinguishable. |
Beta Was this translation helpful? Give feedback.
My suggested answer (going through Discussions for the first time in a while) -
There should be no discernable performance difference between a MAX of a date field versus using LAST with an Order By on the same field. While the underlying mechanism producing the result between the two differs, the end result in terms of time should be nigh-indistinguishable.