Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stilliard/4874172ac0ce7a4ea435 to your computer and use it in GitHub Desktop.
Save stilliard/4874172ac0ce7a4ea435 to your computer and use it in GitHub Desktop.
Select different indexes on the same table across all databases on a server (e.g. a `categories` table)
SELECT table_name, index_name, GROUP_CONCAT(DISTINCT column_name), index_type
FROM information_schema.statistics
WHERE table_name = 'categories'
AND non_unique = 1
GROUP BY table_name, index_name, index_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment