I have a long (and long running, ~30min depending on load) query. It has multiple statements UNION'ed together. Most of the statements are using the GETDATE
function[1].
- Is the function executed once or multiple times?
- If multiple times, would putting it into a
WITH
statement and thenSELECT timestamp FROM <WITH statement>
making it getting executed only once?
[1] https://docs.aws.amazon.com/redshift/latest/dg/r_GETDATE.html