I would suggest taking another step further. I'd take Bill's advice and
work the query in PCC until you're satisfied that it's optimized, then,
if this is a query that is going to be run regularly, turn it into a
stored procedure.
Crystal Reports and applications like it, as good as they are, many
times will only take so far a query that you've designed using their
built-in query designer. The reason is that there are so many SQL
implementations that they must support, and their primary concern is
result set accuracy, not efficiency. Therefore, you never know when,
in the name of result set accuracy, Crystal Reports will generate SQL
that does not result in enough server-side filtering and will depend on
doing at least some client-side filtering, which is an efficiency
killer.
By turning your query (actually, as many queries as you can) into
stored procedures, you can guarantee that no client-side filtering will
happen, simplifying the job that you have to do in CR. Plus, you get
the added benefit of your queries being pre-compiled and waiting for
you in Stored Procedure Cache, at least between restarts of the data
base server.
Just a thought.
Wayne Freeman
Analytica Business Systems
www.analyticabiz.com
datenisis ha scritto:
Quote:
My Crystal Report has joins between 3 tables and I noticed that it
slows down considerably towards the end of the query when I preview the
data.
How can I make it faster? I do not want to create a supertable based
on the joins. |