We have a Dynamics CRM 365 onpremise with some webservices to fetch data for out other applications.
One of the webservices times out and when we trace in SQL what is happening we see that there is one SQL SELECT which reads miliions of rows and takes 88000 milliseconds.
Now, when we take that SQL query and run it separately in SqlServer Management Studio => same query takes 2000 milliseconds !
What can be behind this - it looks like when run from Dynamics CRM it will not use index - how can it work differently ?