June 22, 2004 09:22 PM

Optimizing Variables and Parameters

When the optimizer can't use its usual tools, give it a clue
Rating: (0)
SQL Server Magazine
InstantDoc ID #42801
Last month, in "Inside Search Arguments" (InstantDoc ID 42349), I discussed specific types of search arguments—which I call SARGs—that are most beneficial to the query optimizer when it's determining the best execution plan for a query. In most of the examples I used, if the query didn't contain a SARG that included a specific column, SQL Server wouldn't consider any indexes on that column for the query plan.

Eve...

...This article is for paid Professional Members only.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Professional Membership

Monthly

Annual

VIP Membership

Monthly

Annual

Add a Comment

Great Article. Why I subscribe. Answered questions books don't get into.

big fish 11/18/2004 8:40:33 AM


I've noticed examples where the optimizer will choose a NC bookmark lookup on a table with a clustered index (i.e. 7 logical IOs) when there are only 19 records and a single page in the table itself. Is this an example of the same behaviour you describe in 'Getting Started'? It seems a bit brutal to me when the table only has 1 page. When I used to work with Sybase, I would put good money on the fact that it would never use an index on a table with 1 page in it.

Philip Yale 7/8/2004 8:36:45 AM


You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS