|  | Posted by drawnai on 04/24/06 10:58 
Erland Sommarskog wrote:> David Portas (REMOVE_BEFORE_REPLYING_dportas@acm.org) writes:
 > > In your example you try to force a particular execution plan onto your
 > > code using an INDEX hint. But there is absolutely no reason why SQL
 > > Server should always be required to implement a hint. Indexes are
 > > intended as an optimization tool - they are not supposed to affect
 > > logical behaviour of code.
 >
 > I only like to enforce this: if the result of a query is dependent on
 > the presense of an index, the result of the query is undefined (or there
 > is a plain bug). The task of indexes is to decrease execution times, but
 > they should not affect the outcome of a query.
 
 I'm prepared to put up with checking a view queries once every new
 generation
 of SQL server, for an e-commerce site that will run on a laptop, rather
 than
 pay half a million quid for hardware licence fees, just to do it the
 hard way.
 
 >
 > Of course, by adding an index hint you at least ensure that they query
 > will fail would the index be dropped. Then again, if someone changes
 > the index, you lose anyway.
 >
 >
 >
 > --
 > Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
 >
 > Books Online for SQL Server 2005 at
 > http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
 > Books Online for SQL Server 2000 at
 > http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
  Navigation: [Reply to this message] |