rAinDeEr wrote:
Hi,
Is there any performance issues related to having default timestamps
in tables?
I have a Data Model in which all the tables have created_tms and
last_updated_tms which I have set default value as Current timestamp.
During insert, these values are not given and only during updates the
last_updated_tms is updated to current timestamp.
Does having these affect the performance of the queries or the
database ?
I suppose they take up some space and therefore cause more I/O when the
table is queried (or written to for that matter). But, assuming the
fields aren't a significantly large portion of the row-size I'd guess
that the performance impact would be negligable?
Still, timestamp is quite a "large" datatype in the scheme of things
(10 bytes storage if I recall correctly?)
There's also the issue of whether you're using triggers to maintain the
timestamps on update, which I guess would add a bit to the processing
overhead of updates.
I guess it boils down to: if you don't actually *need* them on every
table, why have them? If you actually have a requirement to track the
created and modification dates (auditing and what-not), then you don't
have much of a choice, but if there's no such requirement I'd opt for
simplicity over complexity :-)
Dave.
--