Skip to content

Conversation

haneslinger
Copy link
Contributor



class SensorReading(models.Model):
reading = models.FloatField(null=True)
timestamp = models.DateTimeField()
timestamp = TimescaleDateTimeField(interval="1 second")
Copy link
Member

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

Copy link
Contributor Author

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

@axelstudios
Copy link
Member

axelstudios commented Jan 12, 2024

PR titles are automatically included in the changelog:

  • Update PR title to be consistent with changelog entries

@haneslinger haneslinger changed the title Fix 4252 Make SensorReadings a timescaledb table. Jan 12, 2024
@axelstudios
Copy link
Member

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

@nllong nllong changed the title Make SensorReadings a timescaledb table. Make SensorReadings a timescaledb table Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants