select id,object_name(id) as tableName,indid,rows,rowcnt
from sys.sysindexes a where indid in(0,1)
order by rows desc
本文介绍了一种通过查询sys.sysindexes视图来获取表名及其索引相关信息的方法,帮助读者了解如何使用SQL语句分析数据库中索引的行数及使用情况,为优化数据库性能提供依据。
select id,object_name(id) as tableName,indid,rows,rowcnt
from sys.sysindexes a where indid in(0,1)
order by rows desc

被折叠的 条评论
为什么被折叠?