Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: report is running slow Post Reply Post New Topic
Author Message
anu009
Newbie
Newbie


Joined: 18 Aug 2010
Online Status: Offline
Posts: 28
Quote anu009 Replybullet Topic: report is running slow
     Posted: 03 Mar 2011 at 1:45pm

My report is not complex though involves lots of views.

There is no page count currently so that could nt be a problem
The joins are on indexed columns.
the selection criteria checks for string from a column of type clob.
 
I am not sure if this is causing the problem.Can someone suggest what to look for and how to optimize my report.
 
The report was running from last five minutes ir brought about 20 records and read around 5000 records.I had to stop the process in between as it was reading all the records.
 
Any suggestions would be helpful.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 04 Mar 2011 at 3:52am
The problem is that it's looking at a CLOB column in the selection criteria - Crystal will do that locally.  If you know how to write SQL, instead of using the views as tables and setting the selection criteria in the Select Expert, I would use a command where you create the entire SQL needed for the report including the selection criteria (if you're using parameters, delete the params from the main report and recreate them in the Command Editor - use quotes around any string parameter when you add it to the SQL.)  This will put all of the processing on the database.  It's likely it will still be somewhat slow as searching through CLOB fields takes some time, but it won't be as slow as doing it in Crystal itself.
 
-Dell
IP IP Logged
anu009
Newbie
Newbie


Joined: 18 Aug 2010
Online Status: Offline
Posts: 28
Quote anu009 Replybullet Posted: 05 Mar 2011 at 7:28am
Thank You.
I am following your approach now and i copied the sql from 'Show SQL Query' in the database option on the command and removed all the exisiting views.
While doing this i observed one thing the sql does nt contain the complete selection criteria when copied from show sql .It left out the statement where i was picking from clob field and then took statements after that.
In the end there was or clause in the selection criteria which again did not show up in the sql.Is it not strange.
Should i addd those statements manually in the sql which i got from show sql query option. what could be the reason of not selcting those lines from criteria in the shoq sql.
 
Thanks again for your help.I really hope this solves the problem.


Edited by anu009 - 05 Mar 2011 at 7:44am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Mar 2011 at 6:54am
When the condition doesn't appear in the SQL it means that Crystal is processing that condition internally instead of having the database process it.  This is what was causing the issues with your report.
 
-Dell
IP IP Logged
anushka
Newbie
Newbie
Avatar

Joined: 10 Apr 2008
Online Status: Offline
Posts: 29
Quote anushka Replybullet Posted: 07 Mar 2011 at 6:56am
Oh and there is no way to force crystal to process the sql on database end but to write a command.I did add a command and the performance has improved. I have to do this for next 20 reports so is this is the only possible option.
Learning can be fun.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Mar 2011 at 10:03am
Correct.
IP IP Logged
anu009
Newbie
Newbie


Joined: 18 Aug 2010
Online Status: Offline
Posts: 28
Quote anu009 Replybullet Posted: 11 Mar 2011 at 9:12am

I have implemented that in most of the reports now , was wondering if there are any drawback of doing that , just to be aware of.

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 11 Mar 2011 at 10:18am
No, not really.  This is the way I develop most of my reports at this point because I have more control for performance tuning on large queries.
 
-Dell
IP IP Logged
anushka
Newbie
Newbie
Avatar

Joined: 10 Apr 2008
Online Status: Offline
Posts: 29
Quote anushka Replybullet Posted: 24 Mar 2011 at 5:40pm
Hi Hify

I was building couple of reports and thanks a lot for your suggestion and it works well.

I have one question now , till now i build up command for all non prompt reports.
Recently i had to do it for one report which had prompt but i am using it to display the row.
SO if the prompt value matches with one of the departments then show group 2 and this is in the section expert.
if matches with section then display group 3 and this formula is in the section expert of group 3.

In this case do i need to create a paramter in the command as i dont know where to put it in the script. Or will it work if i create on the report and use it in the show group formula.

Thank You

Edited by anushka - 24 Mar 2011 at 5:41pm
Learning can be fun.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Mar 2011 at 3:26am
Since you're not using the prompt as a filter for the data, you would create this prompt on the report and then use it in the section expert.
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum