r/SQL • • Oct 12 '26

SQL Server When do you decide a query hint is justified?

/r/u_markinatlanta/comments/1x404yz/when_do_you_decide_a_query_hint_is_justified/
1 Upvotes

2 comments sorted by

2

u/gumnos Oct 12 '26

In the rare events a query-hint improves performance, go ahead and use it, but also leave copious comments to say why and how the query-hint is better than without the query-hint and why the optimizer fails to select the unhinted plan.

2

u/alinroc SQL Server DBA Oct 12 '26

And come back every 6 months and re-evaluate whether that hint is still needed. Query plans can change shape as data volume and skew changes. An hint may be useful today, then a revised (or new, or dropped) index better tomorrow.