Skip to content

Instantly share code, notes, and snippets.

@plasticbrain
Created February 1, 2013 21:55
Show Gist options
  • Select an option

  • Save plasticbrain/4694425 to your computer and use it in GitHub Desktop.

Select an option

Save plasticbrain/4694425 to your computer and use it in GitHub Desktop.
Get the last accessed tables from database
SELECT table_schema AS DatabaseName,
table_name AS TableName,
update_time AS LastAccessTime,
check_time AS LastCheckTime
FROM information_schema.tables
WHERE update_time < 'yyyy-mm-dd'
GROUP BY table_schema
ORDER BY update_time ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment