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
?
regards,
rAinDeEr
Dave Hughes - 23 May 2006 18:31 GMT
> Hi,
>
[quoted text clipped - 9 lines]
> 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.
rAinDeEr - 24 May 2006 04:39 GMT
Hi Dave, Mark...
I am not using triggers to update the last updated user and timestamp.
I just need to track who is updating the table and at what time..So I
guess having them wouldnt matter much..
I dont have a high insert rate either....
thanks a lot..
rAinDeEr
Mark A - 23 May 2006 19:25 GMT
> Hi,
>
[quoted text clipped - 12 lines]
> regards,
> rAinDeEr
Unless you have an extremely high insert rate, I would not worry about it.