The UPDATE_TIME
column in the information_schema.tables
table approximately answers the question "which table was updated". Basic example:
SELECT UPDATE_TIME
FROM information_schema.tables
WHERE TABLE_SCHEMA = 'database' AND TABLE_NAME = 'table'
If you were to run this right after your modifying statements, you could limit to a window of a few seconds to check if a particular table was updated, like:
SELECT COUNT(*)
FROM information_schema.tables
WHERE TABLE_SCHEMA = 'database' AND TABLE_NAME = 'table'
AND UPDATE_TIME BETWEEN (NOW() - INTERVAL 30 SECOND) AND NOW();
which returns 1 if that table was updated in the last 30 seconds, or 0 if not.
I stress this is an approximate answer, because a query other than the one you last executed might have affected that table. If you were to wrap this in a transaction or a lock, then you could use this to actually answer your question: with the cost of write-locking other connections.