MySQL indexing compared to SQL Server
Does MySQL have a sysindexes
table or am I just thinking of SQL Server? If not, is there 开发者_如何学Goan equivalent indexing feature within MySQL at all?
SYS tables are specifically SQL Server; the ANSI equivalent is INFORMATION_SCHEMA
. Part of the reason SYS tables still exist on SQL Server is they sometimes include additional information not in the INFORMATION_SCHEMA tables...
On MySQL, you want to use INFORMATION_SCHEMA.STATISTICS:
SELECT *
FROM INFORMATION_SCHEMA.STATISTICS
WHERE table_name = 'tbl_name'
AND table_schema = 'db_name'
InnoDB tables can definitely be indexed; not sure about the scope available with ISAM tables. The system information stuff is held in the information schema tables:
http://dev.mysql.com/doc/refman/5.0/en/schemata-table.html
精彩评论