title: Why SELECT COUNT(*) performs clustered index scan?
body: <p>I have the following table:</p>
  
  <pre><code>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]
  </code></pre>
  
  <p>And I am trying to execute a query:</p>
  
  <pre><code>SELECT COUNT(*)
  FROM Addr
  </code></pre>
  
  <p>When table contains about 8 million records, it was executing immediately. But now table contains 21 million records, and query is executing very slow. Managemet Studio shows the next estimated plan:</p>
  
  <p><img src="https://i.stack.imgur.com/WkwgN.png" alt="Execution plan"></p>
  
  <p>Screenshot from Storage tab (Table Properties):</p>
  
  <p><img src="https://i.stack.imgur.com/Aj5mr.png" alt="enter image description here"></p>
  
  <p>I am using <code>MSSQL 2008 Express 10.50.1617.0</code>. Why this simple query has such complicated plan?</p>