Setting Query Timeouts in Clarity 7

Back To Blog

Although Clarity 7 performance is fantastic, occasionally we come across OLAP or relational queries that are slow and cause Clarity to timeout.

I was talking about this recently with a good friend of mine, who is both super smart and knows Clarity extremely well, and she said “Just make the query run faster!”.  This is good advice and should be the first approach.   However, often queries are slow for reasons that are fixable, such as optimizing a SQL queries, creating multiple OLAP data maps or adding indexes to the relational database.

That said, sometimes a query is just slow or there isn’t time to make it faster and we just want the report stop timing out. To accomplish this Clarity provides the ability to alter the timeout settings on queries. Relational queries are the easier of the 2 as they can be set by query directly within the template XML. OLAP queries however don’t have any such parameter (unfortunate) and the timeout needs to be set globally within a configuration file.

Setting Timeout for Relational Queries

Follow these steps to set the timeout for a relational query:

    • Open the Report in Clarity Studio
    • Select the Data area and then select a query
    • Open the Code tab (instead of Design) – this should take you to code area for your query
    • Find the <RelationalQuery> section for the problem query and add a Timeout parameter.  The setting represents the number of seconds Clarity will wait for the query to finish.

Setting Timeout for OLAP Queries

Follow these steps to set a higher global timeout for OLAP queries:

    • On the Clarity Server find the \Clarity Systems\ClarityServer\Web\web.config
    • Open the file and find the <system.web> section.
    • Immediately below <system.web> add the following entry, where {timeout} represents your OLAP timeout in seconds:

<httpRuntime executionTimeout=”{timeout}” />

The resulting file should look as follows (with a 10 minute timeout value).

 

In Summary, the first action for slow queries should be to try and improve their performance – but the reality is that is not always an option.  In those situations the above settings will allow you to still run your reports and templates, even if they are a little slower than you would like.