-
Notifications
You must be signed in to change notification settings - Fork 54
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
Make SensorReadings a timescaledb table. #4463
base: develop
Are you sure you want to change the base?
Conversation
seed/models/sensors.py
Outdated
|
||
|
||
class SensorReading(models.Model): | ||
reading = models.FloatField(null=True) | ||
timestamp = models.DateTimeField() | ||
timestamp = TimescaleDateTimeField(interval="1 second") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably stay at the default of 7 days, 1-second sized chunks are super inefficient:
https://www.timescale.com/blog/timescale-cloud-tips-testing-your-chunk-size/#finding-your-optimal-chunk-size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is interval not the granularity of the time stored? I can't find a definition
PR titles are automatically included in the changelog:
|
I think there's a better (magic) process we have to use for timescale tables, I'll add more details soon once I have time to go through this process |
#4252