title: Does Foreign Key improve query performance?
body: <p>Suppose I have 2 tables, Products and ProductCategories. Both tables have relationship on CategoryId. And this is the query.</p>
  
  <pre><code>SELECT p.ProductId, p.Name, c.CategoryId, c.Name AS Category
  FROM Products p
  INNER JOIN ProductCategories c ON p.CategoryId = c.CategoryId
  WHERE c.CategoryId = 1;
  </code></pre>
  
  <p>When I create execution plan, table ProductCategories performs cluster index seek, which is as expectation. But for table Products, it performs cluster index scan, which make me doubt. Why FK does not help improve query performance?</p>
  
  <p>So I have to create index on Products.CategoryId. When I create execution plan again, both tables perform index seek. And estimated subtree cost is reduced a lot.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>Beside FK helps on relationship constraint, does it have any other usefulness? Does it improve query performance?</p></li>
  <li><p>Should I create index on all FK columns (liked Products.CategoryId) in all tables?</p></li>
  </ol>