[ postfixadmin-Bugs-2931773 ] No unique keys in log table
Brought to you by:
christian_boltz,
gingerdog
|
From: SourceForge.net <no...@so...> - 2011-04-23 19:56:09
|
Bugs item #2931773, was opened at 2010-01-14 02:58 Message generated for change (Comment added) made by christian_boltz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2931773&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Database Group: v 2.3 Status: Open Resolution: None Priority: 5 Private: No Submitted By: W. Rossmann () Assigned to: Nobody/Anonymous (nobody) >Summary: No unique keys in log table Initial Comment: 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. ---------------------------------------------------------------------- >Comment By: Christian Boltz (christian_boltz) Date: 2011-04-23 21:56 Message: (sorry for the late reaction!) I know that the log table does not have an UNIQUE key, however I don't see why it would need one ;-) Our only usage of the log table is to display the most recent entries per domain, sorted by timestamp - and this works fine without an UNIQUE key. Is there a special reason why you think we should add an UNIQUE key like an autoincrement? (BTW: I won't use microtime as unique key - according to Murphy, there will be conflicts ;-) BTW: I just added an index on the domain and timestamp column (SVN trunk r1050) to speedup logview. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2931773&group_id=191583 |