<s>
In	O
relational	B-Application
databases	I-Application
,	O
a	O
condition	O
(	O
or	O
predicate	O
)	O
in	O
a	O
query	O
is	O
said	O
to	O
be	O
sargable	B-Application
if	O
the	O
DBMS	B-General_Concept
engine	O
can	O
take	O
advantage	O
of	O
an	O
index	B-Data_Structure
to	O
speed	O
up	O
the	O
execution	O
of	O
the	O
query	O
.	O
</s>
<s>
It	O
was	O
first	O
used	O
by	O
IBM	O
researchers	O
as	O
a	O
contraction	O
of	O
Search	O
ARGument	O
,	O
and	O
has	O
come	O
to	O
mean	O
simply	O
"	O
can	O
be	O
looked	O
up	O
by	O
an	O
index.	O
"	O
</s>
<s>
A	O
query	O
failing	O
to	O
be	O
sargable	B-Application
is	O
known	O
as	O
a	O
non-sargable	O
query	O
and	O
typically	O
has	O
a	O
negative	O
effect	O
on	O
query	O
time	O
,	O
so	O
one	O
of	O
the	O
steps	O
in	O
query	B-Language
optimization	I-Language
is	O
to	O
convert	O
them	O
to	O
be	O
sargable	B-Application
.	O
</s>
<s>
The	O
effect	O
is	O
similar	O
to	O
searching	O
for	O
a	O
specific	O
term	O
in	O
a	O
book	O
that	O
has	O
no	O
index	B-Data_Structure
,	O
beginning	O
at	O
page	O
one	O
each	O
time	O
,	O
instead	O
of	O
jumping	O
to	O
a	O
list	O
of	O
specific	O
pages	O
identified	O
in	O
an	O
index	B-Data_Structure
.	O
</s>
<s>
The	O
typical	O
situation	O
that	O
will	O
make	O
a	O
SQL	B-Language
query	I-Language
non-sargable	O
is	O
to	O
include	O
in	O
the	O
WHERE	O
clause	O
a	O
function	O
operating	O
on	O
a	O
column	O
value	O
.	O
</s>
<s>
The	O
SELECT	O
clause	O
,	O
on	O
the	O
other	O
hand	O
,	O
can	O
contain	O
non-sargable	O
expressions	O
without	O
adversely	O
affecting	O
the	O
performance	O
.	O
</s>
<s>
Conceptually	O
,	O
an	O
index	B-Data_Structure
is	O
simply	O
a	O
mapping	O
between	O
a	O
value	O
and	O
one	O
or	O
more	O
locations	O
.	O
</s>
<s>
With	O
a	O
functional	O
index	B-Data_Structure
,	O
the	O
value	O
stored	O
in	O
the	O
index	B-Data_Structure
is	O
the	O
output	O
of	O
the	O
function	O
specified	O
when	O
the	O
index	B-Data_Structure
is	O
created	O
.	O
</s>
<s>
This	O
capability	O
expands	O
what	O
is	O
sargable	B-Application
beyond	O
base	O
column	O
expressions	O
.	O
</s>
<s>
Sargable	B-Application
operators	O
:	O
</s>
<s>
Sargable	B-Application
operators	O
that	O
rarely	O
improve	O
performance	O
:	O
</s>
<s>
clauses	O
that	O
are	O
sargable	B-Application
typically	O
have	O
field	O
values	O
on	O
the	O
left	O
of	O
the	O
operator	O
,	O
and	O
scalar	O
values	O
or	O
expressions	O
on	O
the	O
right	O
side	O
of	O
the	O
operator	O
.	O
</s>
<s>
Not	O
sargable	B-Application
:	O
</s>
<s>
This	O
is	O
not	O
sargable	B-Application
because	O
myIntField	O
is	O
embedded	O
in	O
a	O
function	O
.	O
</s>
<s>
Sargable	B-Application
version	O
:	O
</s>
<s>
This	O
is	O
sargable	B-Application
because	O
myIntField	O
is	O
NOT	O
contained	O
in	O
a	O
function	O
,	O
making	O
any	O
available	O
indexes	O
on	O
myIntField	O
potentially	O
usable	O
.	O
</s>
<s>
...	O
clauses	O
that	O
are	O
sargable	B-Application
have	O
field	O
values	O
on	O
the	O
left	O
of	O
the	O
operator	O
,	O
and	O
text	O
strings	O
that	O
do	O
not	O
begin	O
with	O
the	O
on	O
the	O
right	O
.	O
</s>
<s>
Not	O
sargable	B-Application
:	O
</s>
<s>
This	O
is	O
not	O
sargable	B-Application
.	O
</s>
<s>
Sargable	B-Application
version	O
:	O
</s>
<s>
This	O
is	O
sargable	B-Application
.	O
</s>
<s>
It	O
can	O
use	O
an	O
index	B-Data_Structure
to	O
find	O
all	O
the	O
myNameField	O
values	O
that	O
start	O
with	O
the	O
substring	O
.	O
</s>
