SQL Server query hints which are not much popular but very powerful
2020, Apr 13
I learned some new query hints which we can use when troubleshooting query performance issues. Those are mentioned below;
-- forces the query to use follow the join order as it specifies in the query and also makes all the joins as hash joins
option (force order, hash join) -
-- to generate a query plan using the simple containment
option (use hint ('ASSUME_JOIN_PREDICATE_DEPENDS_ON_FILTERS'))
-- to eliminate the merge join
option ( hash join)
-- Force to use the legacy cardinality estimator
option ( force_Legacy_cardinality_estimation)
-- combine two query hints
option (use hint ('ASSUME_JOIN_PREDICATE_DEPENDS_ON_FILTERS')) and (force order )
Further reading
About the post header picture: It was taken during the hike in Roral Arch Trail in Colorado Mar, 7th 2020. This is how the city is seen from the Arch Trail final point.