You are here: Re: Using muliple smaller SPs and Functions better than using 1 big SP? « MsSQL Server « IT news, forums, messages
Re: Using muliple smaller SPs and Functions better than using 1 big SP?

Posted by Alexander Kuznetsov on 12/10/05 00:06

> Sometimes you need to reuse a table expression in a query. In this case a
> table variable or temp table may be a good idea to hold the intermediate
> result, so that it is only computed once.

Erland,

also sometimes we materialize intermediate results in a temporary
table, build some indexes on it, so that there are statisitcs on the
temp table. This way the optimizer must recompile, and it considers the
statistics on the temp table in the process. As a result, we may get a
much better plan and much faster execution.
Sometimes, not always, not often.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация