Prev: Odd behavior in SSRS 2005: different totals in dev version and deployed server version
Next: Getting total pages per group/section
From: PhilBob on 12 Apr 2010 06:36 Hey, I have a created a report model which sits on top of a data warhouse, and for the most part it works fine. I am having an issue where te sql generated by the report is really bad and slowing down the report to crawl. Here is an exmaple of the sql SET DATEFIRST 7 SELECT [BESPOKE_factStates2].[LinkedReferenceList] [LinkedReferenceList], [BESPOKE_factStates].[RealTimeState] [RealTimeState], [BESPOKE_factStates].[Ref] [Ref] FROM ( SELECT [BESPOKE_factStates].[Ref] [RealTimeState], [BESPOKE_factStates].[Ref] [Ref] FROM [Realtime].[BESPOKE_factStates] [BESPOKE_factStates] ) [BESPOKE_factStates] LEFT OUTER JOIN ( SELECT [BESPOKE_factStates].[Ref] [RealTimeState], [BESPOKE_factStates].[Linked_ReferenceList] [LinkedReferenceList] FROM [Realtime].[BESPOKE_factStates] [BESPOKE_factStates] ) [BESPOKE_factStates2] ON [BESPOKE_factStates].[RealTimeState] = [BESPOKE_factStates2].[RealTimeState] If any more details are required please ask, I very stuck Thanks PhilBob
From: Uri Dimant on 12 Apr 2010 07:53
Hi Does not it work for you? Why do not you have a WHERE condition? SELECT <columns> FROM BESPOKE_factStates AS BF1 LEFT JOIN BESPOKE_factStates AS BF2 ON BF1.[RealTimeState]=B2.[RealTimeState] "PhilBob" <PhilBob(a)discussions.microsoft.com> wrote in message news:044199A6-7027-4149-B640-037A0AB73CDB(a)microsoft.com... > Hey, > > I have a created a report model which sits on top of a data warhouse, and > for the most part it works fine. I am having an issue where te sql > generated > by the report is really bad and slowing down the report to crawl. > > Here is an exmaple of the sql > > SET DATEFIRST 7 > SELECT > [BESPOKE_factStates2].[LinkedReferenceList] [LinkedReferenceList], > [BESPOKE_factStates].[RealTimeState] [RealTimeState], > [BESPOKE_factStates].[Ref] [Ref] > FROM > ( > SELECT > [BESPOKE_factStates].[Ref] [RealTimeState], > [BESPOKE_factStates].[Ref] [Ref] > FROM > [Realtime].[BESPOKE_factStates] [BESPOKE_factStates] > ) [BESPOKE_factStates] > LEFT OUTER JOIN ( > SELECT > [BESPOKE_factStates].[Ref] [RealTimeState], > [BESPOKE_factStates].[Linked_ReferenceList] > [LinkedReferenceList] > FROM > [Realtime].[BESPOKE_factStates] [BESPOKE_factStates] > ) [BESPOKE_factStates2] ON [BESPOKE_factStates].[RealTimeState] = > [BESPOKE_factStates2].[RealTimeState] > > If any more details are required please ask, I very stuck > > Thanks > > PhilBob |