title: TSQL - same query is slow on one server but very fast on another
body: <p>This query</p>
  
  <p>SELECT MAX(ID) FROM GeoArea</p>
  
  <p>is very fast on a production server (16Gb RAM). It executes within 1 second.</p>
  
  <p>But it is very slow on a test server (3Gb RAM). It takes more than 10 minutes (stil in progress!).</p>
  
  <p>Database is the same. SQL Server version is the same.</p>
  
  <p>The table has 2 million rows.
  Why is it slow on a test server? I thought it is just a cluster index scan.</p>
  
  <p>UPDATE</p>
  
  <p>SQL restart did not help.
  I've copied the production DB to the test server and it solved the problem. </p>