calculate first- / last_msg
currently the last MeasurementLocation is taken for both last/first Three options come to mind:
Track last_first msg in Sensor node and use that to update pid:
probably pretty easy to implement, danger of inconsistency between Measurement and Sensor Nodes, redundant info also requires slightly more storage
Calculate minmax from all MeasurementLocations when updating pid:
should be fast enough, no redundancy, robust against any database change
last_msg
without comparison.
Assume we create the PID when processing the oldest Measurement and that the current Measurement is always the newest. Only update This is simply not robust. Assumptions not met.
Edited by Jakob Leonard Hördt