The cleanup function in postgresql.go deletes from table observation rows with obs times outside the current valid range.
This function should also delete rows from tables time_series and geo_point which no longer have any foreign key references to their id column. I.e. if the last observation that referred to a particular time series was just deleted, that time series can be removed (NOTE: the same time series (i.e. with the same metadata combo) may of course be reintroduced at a later point. Such a scenario will typically occur for sensors that are temporarily down for a period of more than a day.)
The motivation for cleaning up also time_series and geo_point is twofold:
Saving resources (by keeping only relevant rows, i.e. rows associated with observations currently existing in the store).
Increasing the consistency of the information returned by the GetTSAttrGroups method (more cleanup = more of the rows are relevant).
The
cleanup
function inpostgresql.go
deletes from tableobservation
rows with obs times outside the current valid range.This function should also delete rows from tables
time_series
andgeo_point
which no longer have any foreign key references to theirid
column. I.e. if the last observation that referred to a particular time series was just deleted, that time series can be removed (NOTE: the same time series (i.e. with the same metadata combo) may of course be reintroduced at a later point. Such a scenario will typically occur for sensors that are temporarily down for a period of more than a day.)The motivation for cleaning up also
time_series
andgeo_point
is twofold:GetTSAttrGroups
method (more cleanup = more of the rows are relevant).