Most Popular Query Hints

How MySQL Query Hints Impact Performance

MySQL has a small number of query hints that can affect performance. There are hints that affect the total query and those that affect how individual table indexes are used. Total Query Hints All of the total query hints occur directly after the SELECT keyword. These options include SQL_CACHE, SQL_NO_CACHE, SQL_SMALL_RESULT, SQL_BIG_RESULT, SQL_BUFFER_RESULT, SQL_CALC_FOUND_ROWS, and […]

Read More

How to Optimize for a Typical Parameter in SQL Server

There might be cases when most of the executions of a query use the same execution plan and you want to avoid an ongoing optimization cost by reusing that plan. In these cases, you can use a hint introduced with SQL Server 2005 called OPTIMIZE FOR, which is useful when an optimal plan can be […]

Read More

When SQL Server Query Hints Can Improve Performance

SQL is a declarative language; it only defines what data to retrieve from the database. It doesn’t describe the manner in which the data should be fetched. That, as we know, is the job of the query optimizer, which analyzes a number of candidate execution plans for a given query, estimates the cost of each […]

Read More

Apply a SQL Server Query Hint Without Changing the Code

There might be situations when you need to apply a hint to a query but you are unable or unwilling to change your query code or your application. A common case where this occurs is if you are working with third-party code or applications that you cannot change. Plan guides, a feature introduced with SQL […]

Read More

Two Options for Query Optimization with SQL Server

Working with SQL Server is always a challenge. As developers try to troubleshoot SQL Server performance problems, the first step that take is to look at the queries. This is the most basic step and most important step for most developers. Developers love these challenges of optimization because they can get the maximum visible performance improvements in their […]

Read More

SQL Server Query Hint–JOIN

The JOIN query hint applies to all joins within the query. While this is similar to the join hint that can be specified for an individual join between a pair of tables within a large more complex query, the query hint applies to all joins within the query, whereas the join hint applies only to the pair of tables in the join with which it is associated.

Read More