Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query not using index

Author  Topic 

sdrais
Starting Member

2 Posts

Posted - 2006-07-12 : 12:11:11

I am running a simple query statement that behaves differently on our test database and our production database.

When I run the query in production and look at the execution plan, it (correctly) uses one of the indexes to retrieve the data. I run the same query on the test database and look at the execution plan, and in this case it is using the primary key to perform the query. I am not sure why the execution plan is different between the two databases.

We periodically backup our production database and restore it to the test environment, so the contents of the databases are identical.

I ran a dbreindex on the table and updated the statistics on it with no success.

Any help on this issue will be greatly appreciated, as the problem is quickly rendering our test environment useless.

Thank you.

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2006-07-12 : 19:53:23
Is there a performance difference?
Go to Top of Page

sdrais
Starting Member

2 Posts

Posted - 2006-07-13 : 09:45:31
Yes there is, and that is the whole problem. The simple query runs < 1 second on production, over 30 seconds on the test environment.

However, we have many much more complex stored procedures involving this table. Those are running for about 5 or 6 seconds on production, and take several minutes in the test environment (the webservices are timing out before completion).
Go to Top of Page
   

- Advertisement -