COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: paulmaric on 16 Jun 2009 03:19:09 PM

Title: unnecessary duplicate query
Post by: paulmaric on 16 Jun 2009 03:19:09 PM
I have a report that uses different data containers to display the same results... one is a crosstab and another is a chart.  So I created the crosstab first, then inserted a chart and modified it to use Query1 (crosstab source).  When I look at the SQL for the report, Query1 has 2 actual queries called Query1.0 and Query1.1, which have identical native and Cognos SQL.  Does anyone know why both statements are created and run, when only one is needed?  It's not as bad when the queries are identical because the DB typically can retrieve the cached result quickly, but if there's a slight variation between the data containers (but still from a single Query), the DB would run 2+ queries unnecessarily and performance suffers.  Is there any way to have only the main query run and have all data containers get their data from that one?

Thanks.
Title: Re: unnecessary duplicate query
Post by: blom0344 on 17 Jun 2009 03:26:41 AM
Is this C8 or ReportNet?
Title: Re: unnecessary duplicate query
Post by: paulmaric on 18 Jun 2009 10:35:48 AM
This is Cognos 8.2
Title: Re: unnecessary duplicate query
Post by: SharifJ02 on 02 Jul 2009 09:46:13 AM
Here's my guess: http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos-l/sqlmdx-generated-for-a-crosstab-based-on-relational-source-2473773

Because you're using a crosstab and a chart, they need separate temp files to be created so there are two separate queries.
Title: Re: unnecessary duplicate query
Post by: Suraj on 02 Jul 2009 08:19:54 PM
If you have anything different in sort order and grouping, cognos generates a separate query for each instance.