We have a third party BO running the query around 3AM in the morning. Query uses several views to pull the data. When BO runs it at 3AM, it errors out "A time out occurred while waiting to optimize the query. Rerun the query." This is what I find in event log of the server. But when I run the query through SSMS, it runs within 40 secs. And same results when BO runs it some later time in the morning. I do not find any missing index or anything like that and not sure where to begin troubleshoot from.
Here is the stats from the pro-filer:
Writes : 0
This was working fine for several years without issue and starting to have the problem now all of the sudden.
Any help on this would be greatly appreciated.