MySQL last table alteration time

Dave Smith dave at thesmithfam.org
Wed Mar 28 13:44:13 MDT 2007


Brandon Stout wrote:
> Why not just use a timestamp field on each table?  I don't think it 
> violates any normalization rules, and you don't have to use a trigger:

Because performance would be poor on large tables. In order to find when 
a table was last modified, MySQL would have to scan every row in every 
table. I would also have to modify all my existing tables to include a 
timestamp column. The trigger-based solution has a constant time 
complexity (in terns of each table's row count) for timestamp lookups, 
while your solution appears to be linear (read: long-term problems down 
the road). The trigger-based solution also requires no change to the 
existing tables' schema. Seems superior to me. You?

--Dave



More information about the PLUG mailing list