You are here: Re: Are embedded views (Views within views...) evil and if so why? « MsSQL Server « IT news, forums, messages
Re: Are embedded views (Views within views...) evil and if so why?

Posted by Alexander Kuznetsov on 04/03/06 19:57

I addition to Tony's post, I'd say that SQL Server's optimizer may be
confused by views. For instance, here is a situation I sometimes come
across:

select ... from some_view where
---- a very very very selective predicate on an indexed column
last_name like 'Zar%'

Unfortunately, the optimizer won't push the highly selective predicate
down the view's definition, so the query will run very slowly. However,
if you rewrite the query without using the view, the optimizer will
choose a better plan using the index on last_name.

One may hope that eventually SQL Server will ahve a better
implementation of views, but for the time being in a SQL Server
environment I would use views in moderation.

 

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

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