We have a data collection system that collects measurements from environmental sensors that measure the speed of water flowing through a river or canal. Each measurement generates a fixed number of values โโ(for example, date, time, temperature, pressure, etc.), as well as a list of speed values. The sensors initially supplied three speed values, so I just saved each value in my own column of one table in the FireBird database. A sensor was later introduced that could output up to nine speed values, so I just added six more columns. Despite the fact that most sensors use less than 9 values, I thought this would not be a problem if most columns just contain zeros.
But now I am faced with a new generation that can output anything from 1 to 256 values, and I believe that it will not be very efficient to add another 247 columns, especially since most measurements will contain only 3 to 9 values.
Since measurements are collected every 10 minutes, and the database contains all the data for 30 to 50 sensors, the total amount of data is quite significant after a few years, but it should be possible to generate surveys / graphs for any random period of time.
So what would be the most efficient way to store a list of variable values?
Since each record has its own unique identifier, I assume that I can simply save all speed values โโin a separate table, and each value is marked with a record identifier. I just have a feeling that it will not be very effective, and that after that it will be very slow.
source share