DF211: Index hint is used.

The topic describes the DF211 T-SQL code analysis rule.

Category

PERFORMANCE

Message

Index hint is used.

Description

For better performance, avoid using index hints.

Additional information

It is worth mentioning that using index hints can have implications for performance and query optimization. While index hints can sometimes be useful in guiding the query optimizer to choose a specific index, they can also lead to suboptimal query plans and hinder the database’s ability to adapt to changing conditions or statistics. Instead, it is generally recommended to rely on the query optimizer’s capabilities to choose the most efficient execution plan based on available indexes, statistics, and query parameters.

Noncompliant code example

UPDATE d
SET txt = 'sample'
FROM dbo.DemoTable d WITH(INDEX(MyIndex))
WHERE id = 1
GO

Compliant solution

UPDATE d
SET txt = 'sample'
FROM dbo.DemoTable d
WHERE id = 1
GO

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?