i'm creating table in mysql using innodb. table contain measurements several locations. data should stored is:
- monitor_id - id of monitor (indexed)
- time - time of measurement, resolution in seconds (indexed)
- value - current value
in time, there might many million new rows every day.
my questions are:
do need primary key? sake of application don't need pk, database might? if so, bad idea use bigint?
is bad idea store time mysql datetime? or should use integer store unix_timestamp? matter in long run? column indexed.
- yep. better have id pk. autoincrement (bigint ok)
- int better highload. less data store (& index) more logic in app (not in queries).
Comments
Post a Comment