MySQL: 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
This protip is part of a series on information_schema
.
A treasure trove of useful information, such as:
SELECT *
FROM information_schema.statistics
WHERE table_schema = 'my_db' ;
Written by Stilliard
Related protips
1 Response
Also, here's a gist for quick ref or forking: https://gist.github.com/stilliard/4874172ac0ce7a4ea435
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#