SQL count(*) performance

后端 未结 5 1521
自闭症患者
自闭症患者 2020-11-28 06:26

I have a SQL table BookChapters with over 20 millions rows. It has a clustered primary key (bookChapterID) and doesn\'t have any other keys or indexes. It takes miliseconds

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 07:16

    try this if you only want to know rows count:

    exec sp_spaceused [TABLE_NAME]
    

提交回复
热议问题