if Select SQL take lots of time, try below options
- Inner HASH JOIN
- Query
hint - Option (recompile) – running
more than 20 minutes, cancelled query
- Cross
Apply/Outer Apply
(Optimize the query to use cross apply/outer apply instead of subquery) – completed in 4 min - Use Temp table with
index
- Create update statement
to replace sub query
- Query
hint - FORCE_LEGACY_CARDINALITY_ESTIMATION
Use this hint in select statement
option (use hint('FORCE_LEGACY_CARDINALITY_ESTIMATION'))
SELECT *
FROM Schema.Table
WHERE Condition = 'Value'
OPTION (USE HINT ('FORCE_DEFAULT_CARDINALITY_ESTIMATION'));
Comments
Post a Comment