Skip to content

move some jsonb fields from states_raw to entities table #32

Description

@fergalish

Is your feature request related to a problem? Please describe.
I'm trying to reduce unnecessary consumption of disk space. Some key/value pairs in states_raw.attributes::jsonb never change and therefore don't need to be recorded with every state or value update.
I'm thinking of the unit_of_measurement and friendly_name key/values, but really applies to any key/value that never changes (source, domain, device_class, etc).

Describe the solution you'd like
These key/value pairs could be moved to the entities table.

Describe alternatives you've considered
Timescaledb compression means there's probably very little long term overhead, but still...
Or there might be some rationale behind it e.g. maybe some users do occasionally change the friendly_name?

Additional context
None.

p.s. thank you for this integration. Took me a few days of trying alternatives before finding it! Prometheus, ltss, victoriametrics, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions