==============================================
まとめてデータベース内のテーブルストレージタイプをリスト
==============================================


SELECT table_name, table_type, engine
FROM information_schema.tables
WHERE table_schema = 'TEST'
ORDER BY table_name DESC;

my_info

==============================================
テーブルで利用されているインデックスの数リスト
==============================================


SELECT
t.table_schema,t.table_name
,COUNT( IF(c.column_key = 'PRI',1,NULL) ) AS PK
,COUNT( IF(c.column_key != 'PRI',1,NULL) ) AS POSSIBLE
FROM information_schema.tables t
LEFT JOIN information_schema.columns c
ON t.table_schema = c.table_schema
AND t.table_name = c.table_name
AND c.column_key != ''
WHERE t.table_type != 'VIEW'
AND t.table_schema = database()
GROUP BY t.table_name
ORDER BY table_schema, table_name;

te-buru_key

==============================================
DBオブジェクトリスト
==============================================


(SELECT
table_schema AS object_schema,
table_name AS object_name,
table_type AS object_type
FROM information_schema.tables
)
UNION ALL
(SELECT
routine_schema,
routine_name,
routine_type
FROM information_schema.routines )
UNION ALL
(SELECT
trigger_schema,
trigger_name,
'TRIGGER'
FROM information_schema.triggers )
ORDER BY object_schema, object_type, object_name;

obj

Comments are closed.

Post Navigation