Find recently modified tables in MariaDB database

The query below lists all tables that was modified in the last 30 days.

Notes

Column update_time depends on table storage engine, so some results can be inaccurate. To read more please visit official documentation

Query

select table_schema as database_name,
       table_name,
       update_time
from information_schema.tables tab
where update_time > (current_timestamp() - interval 30 day)
      and table_type = 'BASE TABLE'
      and table_schema not in ('information_schema', 'sys',
                               'performance_schema','mysql')
      -- and table_schema = 'your database name' 
order by update_time desc;

Columns

  • database_name - database (schema) name
  • table_name - table name
  • update_time - last update time of table (UPDATE, INSERT, or DELETE operation or COMMIT for MVCC)

Rows

  • One row: represents one table in a database (schema)
  • Scope of rows: all tables which was last modified in the last 30 days in all databases (schemas)
  • Ordered by: update time descending

Sample results

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
0
There are no comments. Click here to write the first comment.