|
Posted by Doug on 03/13/06 00:02
so if i am understanding, if you do a select against a view, it takes a
very long time.
but if copy that exact same code into query analyzer or a stored
procedure, it goes MUCH faster.
and If I am understanding correctly the issue, there will be an index
on eccrootid.
And, if I am understanding, the view won't use the index on ECCrootid,
but everything else will.
Do I have the issue correctly? If so, yup, it does that in SS2000. You
can try compiler hints in the view to FORCE it to sue the index, but
that only works sometimes.
Best workaround is to move all your views to stored procedures, and
pass the eccrootid parameter to the sproc.
I reported this 5 years ago, adn even discussed it with Erland at that
time.
Views suck.
Regards,
Doug
[Back to original message]
|