Why is SELECT COUNT (*) scanning with a clustered index?

I have the following table:

CREATE TABLE [dbo].[Addr](
    [Address] [char](34) NOT NULL,
 CONSTRAINT [PK_Addr] PRIMARY KEY CLUSTERED 
(
    [Address] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

And I'm trying to execute a query:

SELECT COUNT(*)
FROM Addr

When a table contains about 8 million records, it runs immediately. But now the table contains 21 million records, and the query is very slow. Managemet Studio shows the following calculation plan:

Execution plan

Screenshot from the Storage tab (Table Properties):

enter image description here

I use MSSQL 2008 Express 10.50.1617.0. Why does this simple query have such a complicated plan?

+4
source share
1 answer

. , , , . thre Table Scan Clustered Index Scan. , , , , .

+4

All Articles