You can translate the question and the replies:

One of our View is running longer.

Hi, One of our query is running longer. Scenario-1: We have created one view to get some columns( using case statements) and used 4 to 5 sub queries and joined them individually with main table. Scenario-2: We have modified the Scenario-1 query like mentioned below: --> Created separate views for each sub queries and Joined them individually with main table. In Both the scenario's view is running longer. In Dev/Test Environment , View is almost taking 10 to 15 mins to show output/Result. In Local environment, view is running for 2 to 3 mins and failing with "SQL Server did not return a response. The connection has been closed" Could you please check and assist on above issue
16-01-2023 09:53:40 -0500

1 Answer

Hi, Since you are using CASE statements and subqueries in your views, I think there's a chance that your query is not getting delegated to your data source, therefore the performance is slow. You can verify this if you check the** execution trace** of the view when you run it. You can refer to this [article]( as reference, which shows an example to navigate on the execution trace to identify query delegation to the source. You can also check this documentation for more information on the different [Data Source Configuration Properties](, specially on **delegating scalar functions**. I find this Knowledge Base article regarding [Best Practices in detecting query performance bottlenecks]( a good reference to start when debugging. As for the error message in your local environment, “*SQL Server did not return a response. The connection has been closed*” I suggest to double check the following in your local environment: * Are you using the same driver as in Dev/Test environment? * Are the data source connection details correct? * Can you establish a connection directly to the data source with SQL Management Studio? Hope this helps.
Denodo Team
26-01-2023 18:05:12 -0500
You must sign in to add an answer. If you do not have an account, you can register here