Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate server side use of SERIAL and change type to BIGSERIAL if needed #15

Open
UsualSpec opened this issue Jul 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@UsualSpec
Copy link
Collaborator

UsualSpec commented Jul 16, 2024

At the moment, we use SERIAL IDs in the measurement_data relation:

md_id SERIAL PRIMARY KEY,

Since we will constantly insert data into this table, the md_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

@UsualSpec UsualSpec added the enhancement New feature or request label Jul 16, 2024
@UsualSpec
Copy link
Collaborator Author

BIGSERIAL also needs more space since it's 64-bit. So it is a tradeoff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant