This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C4962E.29F3C4C0
Content-Type: text/plain
Have a question regarding when a Query Plan uses an Index.
I have a basic statement
This query uses the Index Scan:
explain analyse select * from tablea where columna_id < 57
This query uses Seq Scan:
explain analyse select * from tablea where columna_id < 58
There are about 5000 records in this table, and columna_id is the primary
key, which is Indexed... And recently recreated.
My question is why is the Plan not using the index on the second occasions?
Theo
____________________________________________________________ __________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or
communicate to others content that is confidential or subject to
copyright, unless you have the consent of the content owner.
------_=_NextPart_001_01C4962E.29F3C4C0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 5.5.2653.12">
<TITLE>Query Plan</TITLE>
</HEAD>
<BODY>
<BR>
<P><FONT SIZE=3D2 FACE=3D"Arial">Have a question regarding when a Query Pla=
n uses an Index.</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">I have a basic statement</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">This query uses the Index Scan:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">explain analyse select * from tablea wher=
e columna_id < 57</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">This query uses Seq Scan:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">explain analyse select * from tablea wher=
e columna_id < 58</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">There are about 5000 records in this table=
, and columna_id is the primary key, which is Indexed... And recently recre=
ated.</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">My question is why is the Plan not using t=
he index on the second occasions?</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Theo</FONT>
</P>
</BODY>
</HTML>
<table><tr><td bgcolor=3D#ffffff><font color=3D#000000>____________________=
__________________________________________________<br>This email, including=
attachments, is intended only for the addressee<br>and may be confidential=
, privileged and subject to copyright. If you<br>have received this email =
in error, please advise the sender and delete<br>it. If you are not the in=
tended recipient of this email, you must not<br>use, copy or disclose its c=
ontent to anyone. You must not copy or <br>communicate to others content t=
hat is confidential or subject to <br>copyright, unless you have the consen=
t of the content owner.<br></font></td></tr></table>
------_=_NextPart_001_01C4962E.29F3C4C0--
