Storing numeric values as varchar in Timestream

104 Views Asked by At

I am aiming for cost-efficiency in my data handling practices with Timestream, so I have been trying to decide how best to store numeric values that have a range on the lower side (less than 8 digits).

If I have understood the documentation correct, VARCHAR entries are stored as UTF-8 strings, so a low numeric value will take up less space as a VARCHAR than a BIGINT, which is 64-bit. As such, any column I expect to have a low value is stored as a VARCHAR instead of BIGINT. I imagine this has some potential querying implications, however, so I was hoping that someone may be able to enlighten me as to the downsides. Already, when integrating with a Grafana dashboard, I have realized that it does not recognize the VARCHAR as a numeric value, so continuing with my current practice will require me to do some casting. Am I correct on how it will be stored? Is it worth the hassle, however?

0

There are 0 best solutions below