10-15 seconds of pre-compile

Jack,

The following query:
SELECT str_to_date(date_format(v_servicedesk.RegisteredOn, ‘%Y-%m-%d %H’), ‘%Y-%m-%d %H’) AS RegisteredOn, count(*) AS count
FROM v_servicedesk
where ins_upd_ts > ‘2019-01-01’
GROUP BY str_to_date(date_format(v_servicedesk.RegisteredOn, ‘%Y-%m-%d %H’), ‘%Y-%m-%d %H’)
ORDER BY str_to_date(date_format(v_servicedesk.RegisteredOn, ‘%Y-%m-%d %H’), ‘%Y-%m-%d %H’) ASC
OPTION(interpreter_mode=interpret)

Took 2.9secs to execute on the first run and 240 ms on all consecutive runs.

This table contains only 137k records, so I would not expect it to be even fully scanned in over 3 seconds.