There are no keys defined for the log table, which can make it difficult to manage the data on busier servers where it's just not possible to get even a unique composite key.
Two solutions occur to me:
1. Add an autoincremented INT or BIGINT column for a unique ID on each record.
2. Incorporate microtime information into the timestamp, or a separate column
The first method would be easiest, as it only requires adding a column. The second is more efficient though as the microtime could be stored in something as small as an UNSIGNED MEDIUMINT, and you never have to worry about running out of AUTOINCREMENT space.
The caveat to approach #2 would be that log entries prior to the version incorporating this change would have to be discarded as updating all entries prior with new values unique enough to compute a key would be an exercise in tedium. ie. modifying log entries made in the same second to have different microtime values.
Log in to post a comment.