Definition of SARGable

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

more ▼

asked Oct 09, 2009 at 02:49 PM in Default

avatar image

Steve Jones - Editor ♦♦
5.2k 79 94 87

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Oct 10, 2009 at 08:55 AM

avatar image

Grant Fritchey ♦♦
137k 20 47 81

(comments are locked)
10|1200 characters needed characters left

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.

more ▼

answered Oct 09, 2009 at 03:51 PM

avatar image

Ben Adderson ♦♦
371 6 20 12

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Oct 09, 2009 at 02:49 PM

Seen: 5037 times

Last Updated: Oct 15, 2009 at 05:53 AM

Copyright 2018 Redgate Software. Privacy Policy