COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: CharlesAZ on 29 Jan 2015 04:11:14 PM

Title: Performance impact of not putting your prompts on Prompt page
Post by: CharlesAZ on 29 Jan 2015 04:11:14 PM
Greetings!

If I want my prompts(4 of them) and report on same report page vs using prompt page and report page what impact does that have on my report performance if any?  Does Cognos know to run my prompts first...etc....  Enviornment:  Cognos version 10.2.1 Report Studio (4 Dispatchers with 4 report processes each) interactive and batch
Thanks for your time and help in advance.

Charlie
Title: Re: Performance impact of not putting your prompts on Prompt page
Post by: keshavchhn on 29 Jan 2015 10:52:03 PM
If you use prompts on report page instead of prompt page it will enhance performance.
Title: Re: Performance impact of not putting your prompts on Prompt page
Post by: MFGF on 30 Jan 2015 05:00:07 AM
Quote from: keshavchhn on 29 Jan 2015 10:52:03 PM
If you use prompts on report page instead of prompt page it will enhance performance.

Hi,

I'm not entirely sure on that. On what basis would it enhance performance? The same prompts are being issued and sent to the database by the report.

My take on this is that adding prompts to the report page gives you a little more coding to do in the report. If your prompts are on the same page as the data they are filtering, the page cannot be rendered until the prompts are fulfilled (which makes sense - the page needs the results of the query to render.) But the catch-22 is that the prompts that are required for the page to render are actually on that page, so they don't appear until the page renders. The way Cognos works around this conundrum is to auto-generate prompts when the report initially runs (so that there are values it can use to render the page) - just like if you added a filter with a parameter but didn't add a prompt. You can prevent this from happening by adding default selections to your value prompts (or by coding the expressions as macros with a default value embedded in the prompt() macro syntax) so that the page can render initially using these values. Then you have to consider submitting the prompt values. A prompt page will submit the prompt values when you press Finish, but if your prompts are on the main report page you will have to do this yourself. You can either set each value prompt to "Auto Submit" in its properties (which limits you to selecting only a single value) or you can add a prompt button to your page and set the Type property to Reprompt. As you can see, it involves extra work on your part to make this work as desired.

Cheers!

MF.
Title: Re: Performance impact of not putting your prompts on Prompt page
Post by: bdbits on 30 Jan 2015 02:11:22 PM
As MFGF said, you have to do some things to make in-line prompting work well. In particular, you usually do not want the report to actually run until the prompts have been fulfilled and it is time to fetch the results. What I have sometimes done is use a render variable whose value is based on whether the prompts are null. You can set up your render variable expression to check for whatever prompt values you want to require before rendering the data container (crosstab, list, etc.). If the data container is not rendered the query does not run. Your database-sourced prompts will of course run, which only makes sense.

Also, instead of prompt buttons I drop HTML items that render anchors that look like buttons. This sometimes makes styling and other things specific to my needs a little easier, but you may not find it necessary and be happy with the Cognos prompt buttons. The Search button HTML Item might look something like this.

<a id="mySearchButton" href="#" class="bt" style="text-decoration: none;" onClick="doSearch(); return false;">Search</a>

<script type="text/javascript">
function doSearch() {
  if (canSubmitPrompt()) promptButtonFinish();
}
</script>


Title: Re: Performance impact of not putting your prompts on Prompt page
Post by: Robl on 30 Jan 2015 02:46:21 PM
I haven't done any scientific testing, but from development I think that if you are using screen based peompts with default values then a prompt macro is faster than using a ?param?.
If it's an optional prompt with no default then there is no difference.

Title: Re: Performance impact of not putting your prompts on Prompt page
Post by: MFGF on 31 Jan 2015 11:19:45 AM
Quote from: Robl on 30 Jan 2015 02:46:21 PM
I haven't done any scientific testing, but from development I think that if you are using screen based peompts with default values then a prompt macro is faster than using a ?param?.
If it's an optional prompt with no default then there is no difference.

I've never noticed any difference in performance if I'm being honest. Like you, I have not done any scientific testing, though :)

MF.
Title: Re: Performance impact of not putting your prompts on Prompt page
Post by: Robl on 01 Feb 2015 05:46:23 AM
I think it's because a prompt macro exist fully in the query subject but a default value on a prompt page item requires part of the page to be processed too; if you see what I mean.
Title: Re: Performance impact of not putting your prompts on Prompt page
Post by: keshavchhn on 01 Feb 2015 10:41:38 PM
prompt page also took some time to generate and after clicking submit it will hit the query to generate output, however if you use prompt on report page then it will eliminate the prompt page rendering time and provide the basic report output with the selected values.