Hello,
We have a SQL Server 2000 Instance with two database which are exactly the same, one is a restored backup of the other. One of the tables has about 20000000 rows in it. When we run a query which does a count grouping by one of the indexed columns the restored database uses an index and returns the results in about 12 seconds. The original database chooses not use the index and goes for a full scan and takes about 90 seconds. If we force the original database to use the index it only takes 12 seconds. I've tried running update stats and reindex the table but it's made no difference. What gives?
Dave
We have a SQL Server 2000 Instance with two database which are exactly the same, one is a restored backup of the other. One of the tables has about 20000000 rows in it. When we run a query which does a count grouping by one of the indexed columns the restored database uses an index and returns the results in about 12 seconds. The original database chooses not use the index and goes for a full scan and takes about 90 seconds. If we force the original database to use the index it only takes 12 seconds. I've tried running update stats and reindex the table but it's made no difference. What gives?
Dave