I know there's a lot of questions like this one, but I think this is different, and none of them could help me.
When I run a query with execution plan, I get this:
But, even with the index created, it's not using it.
The funny thing is, when I create it in my test environment (same database, same query, same index), it uses it.
Why is my production server not using the index I've created?
This is the same query in my test environment with the same index in the same database.
It's a simple query:
select * from Database where col1 = 'string' and col2 = 'string'
The index I created is:
create index (ix_col1_col2) on Table (col1, col2)
With Aaron's answers, I now have this:
I have the same result with
* and using all fields.
The server still want me to create the same index it's already using. it's because the 0%? it thinks the query it's not using it?
What a strange thing. I used this:
alter index all on table rebuild
and update stats, and now, the query is using the index with 50% CPU.
Is this a good question to help others? or we should close it? since it was a simple problem.
Again thanks Aaron for your help.