Question : Performance Very Slow when SQL View is Added to Data Model in Crystal Report

Hello Experts,

I have a data model in a Crystal Report that has tables from one database, and a SQL View from another database.  The tables and the View live on the same server.  When I run the report, it takes 45 minutes to return my data.  If I remove the View, it takes only 1 minute to return the data.  When I run the SQL query directly from the SQL Management Studio, it also takes only 1 minute to return the data.  So, my question:  When the View is included in the data model, is there something I can do in the Crystal Report to speed up the data return?

Thank you for any help with this.
Respectfully, Chopp

Answer : Performance Very Slow when SQL View is Added to Data Model in Crystal Report

"The tables and the View live on the same server."  I misread this the first time.  Yes, they're on the same server (physical box), but not on the same database. That's what's causing your problems in Crystal Reports. When you join objects from disparate datasources (even if it's the same type of database residing on the same physical machine) you have severe limitations and potential performance issues.

In order to resolve these issues, the best option is to consolidate the various datasources into a single place for Crystal Reports to query.  Here are a couple of options:

1)  Create the view on the same database as the tables, but leave it pointing to the original database.  As far as Crystal Reports is concerned, the tables and view will be on the same database, so there's no issue - this would be my first choice, personally.  Unless you're not allowed to create views on the UDT4 database, you shouldn't have any problems.

2)  Create a SQl Command that reference both the tables and the view.  Since the command will be pointed to a single datasource, you'll eliminate performance issues.

On a side note, WOW that's a lot of vehicles to pass.  Is that the result of selecting every vehicle in the picklist?

~Kurt
Random Solutions  
 
programming4us programming4us