Question

I've a Cognos report in which I've cascading prompts. The Hierarchy is defined in the image attached.

The First Parent (Division) fills the two cascading child in 3-5 seconds. But when I select any Policy, (that will populate the two child beneath) it took around 2 minutes.

Facts:

  • The result set after two minutes is normal (~20 rows)
  • The Queries behind all the prompts are simple Select DISTINCT Col_Name
  • Ive created indexes on all the prompt columns.
  • Tried turning on the local cache and Execution Method to concurrent.
  • I'm on Cognos Report Studio 10.1

Any help would be much appreciated. Thanks,

Nuh

enter image description here

Was it helpful?

Solution

There is an alternative to a one-off dimension table. Create a Query Subject in Framework for your AL-No prompt. In the query itself, build a query that gets distinct AL-No (you said that is fast, probably because there is an index on AL-No). Wrap that in a select that does a filter on ' #prompt('pPolicy')#' (assuming your Policy Prompt is keyed to ?pPolicy?)

This will force the Policy into the sql before it is sent to the database, but wrapping on the distinct AL-No will allow you to use the AL-No index.

select AL_NO from 
(
    select AL_NO, Policy_NO
    from CLAIMS
    group by AL_NO, Policy_NO
)
where Policy_NO = #prompt('pPolicyNo')#

OTHER TIPS

Your issue is just too much table scanning. Typically, one would build a prompt page from dimension-based tables, not the fact table, though I admit that is not always possible with cascading prompts. The ideal solution is to create a one-off dimension table with these distinct values, then model that strictly for the prompts.

Watch out for indexing each field, as the indexes will not be used due to the selectivity of the values. A compound index of the fields may work instead. As with any time you are making changes to the DDL - open SQL profiler and see what SQL Cognos is generating, then run an explain plan before/after the changes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top