title: Hash Match and Nested Loops
body: <p>I have stored procedure which updates one table with data from another table, joind by some field. And that is super fast with no indexes on the first table. I see in execution plan that Hash Match is performed while joining tables. But when I add 3 indexes to the first table it becomes extremely slow and execution plan show that Nested loops is used instead of Hash Match. Why this happens? Why indexes make a problem? And is there a way to solve it without removing indexes?</p>
  
  <p>Edit: When I put back 2 indexes, and remove the 3. one it is fast again. Third index is the problem, maybe because filed it is based on is nchar(255), too long maybe?</p>