SQL 2000, I have a really horrible view that takes about 10 minutes to run. If I copy the view code and run it in query analyser (the select statement part only) and add
option(force order) I can lower that time to 50 seconds.
Here is the problem, the option(force order) syntax appears to be invalid within a view.
I can get the same funtionality by doing the query
select * from myview option(force order) however that brings up the next problem, the view is being called by crystal reports and I can't get Crystal to save that part of the sql code. I am posting this in the Crystal forum also.
So does anyone know if there is a workaround for doing the force in the view?
Changing to a stored proc, is a possiblity but one I am trying to avoid since it would involve changes to a large number of really nasty crystal reports and the interface my program uses to call them.
option(force order) I can lower that time to 50 seconds.
Here is the problem, the option(force order) syntax appears to be invalid within a view.
I can get the same funtionality by doing the query
select * from myview option(force order) however that brings up the next problem, the view is being called by crystal reports and I can't get Crystal to save that part of the sql code. I am posting this in the Crystal forum also.
So does anyone know if there is a workaround for doing the force in the view?
Changing to a stored proc, is a possiblity but one I am trying to avoid since it would involve changes to a large number of really nasty crystal reports and the interface my program uses to call them.