Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Command with multiple select statements Post Reply Post New Topic
Author Message
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Topic: Command with multiple select statements
     Posted: 24 Mar 2011 at 3:59am
I just received a crystal report where I was told the performance was a little questionable.

So I ran it and let it do its work and it came back 9 minutes later.

So I looked at the command used and there were 6 select statements, though each were fairly simple and simply joined two tables.

Do multiple select statements cause that much of a problem in performance?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 4:05am
can you show a bit of a sample?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 4:06am

do you get the same performance issue if you run it as a query in SQL management studio?

9 minutes seesm like it would lock some tables up severely.
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 24 Mar 2011 at 4:26am
I am using PL/SQL and I can't even run the query there for some reason.

The command is pretty straightforward.

Select <some fields> from <some table>
join <another table> on <condition> where <this field> = <something>

{repeat same pattern several times for different tables and fields}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 4:32am

Are the seperate select statements being unioned together?

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 4:49am
In my initial test of trying to write a command that had seperated select statements the only part that was actually availabel in the report was the first select statement and the others were ignored.
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 24 Mar 2011 at 5:09am
Upon further inspection, the other select statements weren't from the command, but instead other tables that were manually selected from the list of tables to choose from (I think)

I was looking at the query through "Show SQL query" so I thought the whole thing was a command.

Edited by Keikoku - 24 Mar 2011 at 5:12am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Mar 2011 at 5:36am
that makes more sense.
I have found commands to be much less efficient in general.
I would disect the overall report data architecture with the command and other tables to see if you can stream line it. The multiple table usage may be causing loops to occurr when reading the data. If you can move the joins  to prevent that you may get a major boost.
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