{"id":65,"date":"2025-07-23T03:53:00","date_gmt":"2025-07-23T03:53:00","guid":{"rendered":"https:\/\/techobjects.net\/?p=65"},"modified":"2025-07-23T03:53:00","modified_gmt":"2025-07-23T03:53:00","slug":"sql-not-choosing-correct-index-forceseek-hint","status":"publish","type":"post","link":"https:\/\/techobjects.net\/?p=65","title":{"rendered":"SQL Not Choosing Correct Index &#8211; ForceSeek Hint"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I ran into an interesting scenario where SQL Server wasn\u2019t utilizing an index and was table scanning.<br><br>There was an existing index that it should have already been using. This caused queries to be slow and timeout.<br><br>To resolve this we added a query hint called \u201cFORCESEEK\u201d. This forces the query optimizer to search for an index to use. <br><br>Be cautious, however, as when using this hint \u201cFORCESEEK\u201d you must have a matching index to utilize appropriately.<br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ran into an interesting scenario where SQL Server wasn\u2019t utilizing an index and was table scanning. There was an existing index that it should have already been using. This caused queries to be slow and timeout. To resolve this we added a query hint called \u201cFORCESEEK\u201d. This forces the query optimizer to search for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[3,5],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-sql","tag-sql","tag-sql-hint"],"brizy_media":[],"_links":{"self":[{"href":"https:\/\/techobjects.net\/index.php?rest_route=\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techobjects.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techobjects.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techobjects.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techobjects.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=65"}],"version-history":[{"count":0,"href":"https:\/\/techobjects.net\/index.php?rest_route=\/wp\/v2\/posts\/65\/revisions"}],"wp:attachment":[{"href":"https:\/\/techobjects.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techobjects.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techobjects.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}