0

I'm considering to use a composite type, array of standard type and array of composite type columns in TimescaleDB hypertable. I'm curious whether using such columns has any downsides like less effective compression comparing to using standard scalar data types?

5
  • I cannot say if TimescaleDB has any specific problems with such data types (by expectation is "no"), but usually it is a bad idea in general to use arrays or composite types in a table definition. Unless you have a compelling reason to do that, don't do it. Commented Jun 21 at 6:16
  • Why is it a bad idea?
    – oliora
    Commented Jul 4 at 8:59
  • I makes INSERT, UPDATE and SELECT more complicated, and there is no benefit. Commented Jul 4 at 9:37
  • To me the benefit is that with arrays a variable number of items can be stored along with other row data (locally) thus getting it does not require joins and random access to other tables
    – oliora
    Commented Jul 6 at 9:11
  • As long as you never need to update individual array elements, join via them or otherwise manipulate the elements of the array, you have a point. Commented Jul 8 at 6:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.