> 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
thevehicle id, timestamp and a key to the detail table.
The second approach would work quite well.
table logentry
id primary unique
vehicleid int
logtime timestamp
table logdetail
logid int
attribute varchar/int
value decimal
textvalue varchar
You can retrieve logentries for specific vehicles, timeframes and attributes - and you can extend more log attributes
withoutchanging the database structure. I would suggest another table for the attributes where you can lookup if it is
atext or numeric entry.
Just my two cents - and performance always matters (later in progress) ;-)