If you are unable to create a new account, please email support@bspsoftware.com

 

Brackets in Cognos SQL where there are inner and outer joins in same query

Started by DSR, 22 Dec 2015 02:48:23 PM

Previous topic - Next topic

DSR

Hello Guru's,

I have a model where I need to create some outer joins between multiple fact tables and inner joins with dimensions. When I do this Cognos is generating SQL like below.
SELECT A.product                 
       A.Loc,B.Col1,C.Qty,D.xyz

FROM  ((TabA A
         INNER JOIN TabB B
                 ON A.key1 = B.key1)
        INNER JOIN TabC C
                ON A.Key2 = C.Key2)
       LEFT OUTER JOIN TabD D                       
                    ON A.Key1 = D.Key1 AND A.Key2 = D.Key2

With the above SQL query is trying to execute all the inner joins first and perform outer join on inner join result set. This way query is taking lots of time to get the results to be displayed and killing query performance, using explain plan or indexes etc...is not working as result set is from temp (Inner join result set). Can someone help me with a technique how I can remove these brackets when I create FM model. With this scenario its killing my reports and SQL performance whenever I use my FM model.

Happy Christmas to All of you !!

Thanks,
DSR

bdbits

Why are you joining fact tables? Your schemas should be star or snowflake with fact tables joined to conformed dimensions. Cognos will find the join paths between multiple fact tables through the conformed dimensions.

I suspect if you model it that way your queries will turn out much better.