question

Steve Jones - Editor avatar image
Steve Jones - Editor asked

Definition of SARGable

What does SARGable mean? I see this posted in forums.

sql-serverindexingdatabase-designsargable
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered

I've read the article on Wikipedia before. I don't think it's entirely accurate. What does the use of a covering index have to do with SARGable?

Anyway, it's a measure of whether or not the query can use an index. Specifically, whether or not predicates in WHERE clauses and JOIN clauses will prevent the use of an index. There are operators that are SARGable and ones that are not. SARGable operations would include =,>,<, BETWEEN, and some LIKE conditions. Non-SARGable operations would include <>,!=,NOT IN, OR, other LIKE conditions.

The use of a function on a column can render the query Non-SARGable as well.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ben Adderson avatar image
Ben Adderson answered

According to Wikipedia:

In relational databases, a condition (or predicate) in a query is said to be sargable if the DBMS engine can take advantage of an index to speed up the execution of the query (using index seeks, not covering indexes). The term is derived from a contraction of Search ARGument Able.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.