Paul Gielens:ThoughtsService

another Endpoint to my thoughts

News

Syndication

Ads


Favorites

Projects

SQL execution plan horror

Why the HELL does sql server 7 wreck the execution plan compared to regular sql queries? My raw sql works perfectly within a time span of 5 sec whereas the sproc measures more than 2 minutes? I tried defaulting params so the huge table scan as shown by the execution plan uses index seek instead. Also I tried these google tips but that wouldn’t solve my problems either. Any ideas?

Some SQL goodies:

SELECT CustName
FROM Customers
WHERE CustID = 10

CREATE PROC FetchBogusCustomer(
            @ID int)
AS
SELECT CustName
FROM Customers
WHERE CustID = @ID
GO

Comments

No Comments