Re: [GENERAL] time series query

2007-04-02 Thread Jaime Silvela
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

Re: [GENERAL] time series query

2007-04-02 Thread William Garrison
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:

Re: [GENERAL] time series query

2007-04-02 Thread Jaime Silvela
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