Here I need help from SQL administrators. I have two separate instances of SQL Server on Amazon EC2. One of them is our intermediate environment, and the other is our production environment, but they are configured in the same way (generated from the same image).
We had a database that we copied from the stage onto our production environment last week. The way we copy db to production, we take a backup on it on our intermediate site and restore the backup to production. In any case, we found that in production one specific complex request was turned off after an hour, but this exact request in our intermediate environment ended in 10 minutes.
The explanation plan for both was almost the same, except that on one server he performed a PK scan on a large table (rows 8M), and on the other table he searched for an index. We assume that was the difference. Thus, one server did a lot of disk I / O, and the other did not.
So my question is, what are the reasons that one SQL server installation decides to use the index, while the other ignores it - assuming the same versions of the SQL server and the same dataset? Even better, what are the best ways to figure out why SQL ignores an index?
Linus
source share