DB: move to per-packet tables? #8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This was a design mistake. Mainly because schema generation is now done at the same time as the CAN packet decoders, which felt wrong. EAV is worse, especially for disk size, which turns out to actually be problematic.
New system
We move to tables named per packet, with the following schema
timestamp
idx <optional>
value1
value2
The table will be named
packet_name
. The idx column is used to store repeated packet indexes.We also introduce a packet metadata table:
arbitrary JSON
Direct queries on single packets are now easy:
SELECT timestamp, value1 FROM bms_measurement WHERE timestamp BETWEEN <etc>
Joins are slightly more complex, but better than they were previously.
tbh i don't know the rest