The Forceseek table hint instructs the SQL server query optimizer to only use an index seek operation when accessing the specified table, overriding the optimizer’s default plan selection. This can improve the performance by reducing the number of rows read, but it should be use carefully.
Syntex
Select * from table with
(Forceseek) where column1=’value’
This will force SQL server to use
an index seek instead of scanning the entire index. It improves performance if
an index exists and it suitable for this query. It reduces I/O and CPU usage
when filtering on index column.
It can cause query failure if no
suitable index exits. It is not always faster. Forcing a seek may cause
excessive lookups if many rows are returned.
No comments:
Post a Comment
If you have any doubt, please let me know.