dbTalk Databases Forums  

performance issues related to timestamps

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss performance issues related to timestamps in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rAinDeEr
 
Posts: n/a

Default performance issues related to timestamps - 05-23-2006 , 02:48 AM






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


Reply With Quote
  #2  
Old   
Dave Hughes
 
Posts: n/a

Default Re: performance issues related to timestamps - 05-23-2006 , 12:31 PM






rAinDeEr wrote:

Quote:
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.

--



Reply With Quote
  #3  
Old   
Mark A
 
Posts: n/a

Default Re: performance issues related to timestamps - 05-23-2006 , 01:25 PM



"rAinDeEr" <tariqrahiman (AT) gmail (DOT) com> wrote

Quote:
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

Unless you have an extremely high insert rate, I would not worry about it.




Reply With Quote
  #4  
Old   
rAinDeEr
 
Posts: n/a

Default Re: performance issues related to timestamps - 05-23-2006 , 10:39 PM



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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.