Search Postgresql Archives

Searing array fields - or should I redesign?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
I have a process that is logging data from vehicles. I'm looking for thoughts on the pros and cons of different approaches to storing this data - and retrieving it. Different vehicles report different types of data. The current process stores the data in a multi-dimensional array.

eg, insert into logtable values ( 'vehicle123', now(), {{'voltage','13'},{'rpm','600'}};

However, I am not sure how I can write a query - for example to read all records where the voltage field is less than 13. Performance in this case is not a real significant issue.

Would I be better off redesigning and having a master / detail kind of structure? Where the master table would have the vehicle id, timestamp and a key to the detail table. The detail table would then have the key, the type of measurement and then the value.

I guess a third approach would be to just have the detail table with duplication on the vehicle id and time - for each data type recorded.

Thanks,
Bryan.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux