Execution Plan Won't use Index on View

  • Hello all,

    I have a general question, and need a general answer (thus no specific code will be posted)

    I basically have a view that joins 4 tables - and it has a clustered index on the view. However it will not use this index when I want it to, and when I use query hints, I get the "Warning: Index hints supplied for view 'vw_myview' will be ignored." message.

    Any quick solutions to this? If not then I'll use my plan b.

  • What edition of SQL Server are you using?

    If you aren't using Developer, Enterprise, or a higher edition I believe that you have to add the WITH (NOEXPAND) hint to the query referencing the view to get it to use the index that you created on the view.

  • Thank you that did the trick.

  • Your welcome, thanks for letting me know that it helped.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply