SO a client calls in with a problem that has started happening recently and as it turns out the problem seems to be date related. I have a SQL database obviously, and a table with several indexes on the table. I have 2 queries that are setup exactly the same, except the date range specified does vary.
When the date range is older then it will use one index, which is super fast. When the date range is newer, it will use a different index which is much slower.
The query is hitting 2 seperate tables, however the date is only found in one table.
So the question for me is what would make the query switch which index it was going to use?
I have rebuilt the index and ran a updatestats full on the index I am wanting both queries to use, Just a bit at a loss as to what to look at?
Any help is appreciated!!!