Open UsualSpec opened 1 month ago
At the moment, we use SERIAL IDs in the measurement_data relation: https://github.com/nsg-ethz/autopower/blob/956049c2fef02fe1763eb596110164ac253092c1/server/database_schema.sql#L49 Since we will constantly insert data into this table, the md_id will also increment per sample.
measurement_data
md_id
SERIAL is a signed 32-Bit INT and could overflow in the far future. Depending on the sampling interval and how many devices are deployed, we could hit the maximum integer value one day. We may want to change to a BIGSERIAL instead.
BIGSERIAL
As reference, see: https://dba.stackexchange.com/questions/47591/should-i-be-concered-by-large-serial-values
BIGSERIAL also needs more space since it's 64-bit. So it is a tradeoff.
At the moment, we use SERIAL IDs in the
measurement_data
relation: https://github.com/nsg-ethz/autopower/blob/956049c2fef02fe1763eb596110164ac253092c1/server/database_schema.sql#L49 Since we will constantly insert data into this table, themd_id
will also increment per sample.SERIAL is a signed 32-Bit INT and could overflow in the far future. Depending on the sampling interval and how many devices are deployed, we could hit the maximum integer value one day. We may want to change to a
BIGSERIAL
instead.As reference, see: https://dba.stackexchange.com/questions/47591/should-i-be-concered-by-large-serial-values