SQL Server's use of Indexes
Filter is often used to filter out some records when writing SQL statements)
1 WhereAmount>4000 AndAmount<6000
The above statement is the filtering condition.
Of course, this does not mean the SQL server where clause, or SQL Server's use of indexes.
In SQL Server, indexes are useless for expressions without the Sarg operator, and it is difficult for SQL Server to use a more optimized approach for them.
If your SQL statement does not contain the WHERE clauseNon-Sarg OperatorsYour SQL statement will not use the index in the table.
Which of the following areNon-Sarg Operators:
Non-Sarg operators include
Not,
<>,
Not exists,
Not in,
Not like
The rule is"Not"Keyword orNot equalBasically, indexes cannot be used.
There are also some internal functions. If these internal functions are used, sqlserver does not use indexes.
Internal functions, such:Convert (), upper (), etc.