Re: A new proof of the superiority of set oriented approaches: numerical/time serie linear interpolation



Cimode wrote:
... So, we have a *train_passage* table like
this (I supposed a SK ID)

ID Distance ArrivalTime
24 0.289 2000-01-01 06:29:00.000
25 0.193 NULL --> 1st value to be interpolated
26 0.299 NULL --> 2nd value to be interpolated
27 0.131 NULL --> 3rd value to be interpolated
28 0.444 NULL --> 4th value to be interpolated
29 0.16 NULL --> 5th value to be interpolated
30 0.665 NULL --> 6th value to be interpolated
31 0.186 2000-01-01 06:33:00.000

The point of the problem was to interpolate all NULL ArrivalTime
values, ...

I do believe it's helpful to try to write down a predicate. When I try this it's not clear just what Distance and ArrivalTime are attributes of. Whereas they make more sense to me when they are attributes of pairs of ID's. I suspect we get into trouble with the RM when we don't do this.

Can't comment on the SQL, most of that language is beyond me, but it does seem that if the ID's can be paired and assuming SQL can isolate pairs that fall into some pair interval, explosive procedures can be avoided, ie. each tuple that does have a known ArrivalTime ought to be physically retrieved only once.

p
.