How can I determine when an InnoDB table was last changed?

If you're not really interested when the database was changed, but want to know wether or not one database table was changed you should look into MySQL CHECKSUM TABLE

Hope this helps.


This is MySQL bug 14374, 15438, and underlying InnoDB bug 2681.

I have two suggestions (other than patching MySQL).

  1. If you're using one table per file (innodb_file_per_table), stat the underlying file. You could write a MySQL function/extension to do this. This may lag slightly, due to database caching.
  2. You can use after update, delete, and insert triggers to keep your own metadata table with the last update times for each table you're concerned with.

I'd personally suggest the second, as its much more portable and doesn't depend on implementation details (such as innodb_file_per_table).

Tags:

Mysql

Innodb