From: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
To: pgsql-sql@postgresql.org
Subject: Query Plan
Date: Thu, 9 Sep 2004 15:30:48 +1000
Message-ID: <82E30406384FFB44AFD1012BAB230B55037D0584@shiva.au.lpint.net> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: Theo.Galanakis@lonelyplanet.com.au
Subject: Re: Query Plan
In-Reply-To: <82E30406384FFB44AFD1012BAB230B55037D0584@shiva.au.lpint.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox