Good idea. I tried it and got a 12% decrease in execution time!
Still slower than the usual JOIN, but not by that much.
William Garrison wrote:
Would it speed things up siginficantly if you set the dtval_smaller()
function to be immutable? Volatile is the default, so it may be
redundantly eval
Would it speed things up siginficantly if you set the dtval_smaller()
function to be immutable? Volatile is the default, so it may be
redundantly evaluating things.
Jaime Silvela wrote:
In case anyone is interested, I was able to solve this, more or less.
Here's my new "Latest value" query:
In case anyone is interested, I was able to solve this, more or less.
Here's my new "Latest value" query:
select obj_id, val_type_id, (max(row(observation_date, val))).val
from measurements
group by obj_id, val_type_id
It was only necessary to define a new (date, numeric) type. Below is the