pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kishore B <kishorebh@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why Index is not working on date columns.
Date: Tue, 25 Oct 2005 09:38:35 -0400
Message-ID: <13279.1130247515@sss.pgh.pa.us> (raw)
In-Reply-To: <42567e060510250147j582ce648p3ceef8e4376975be@mail.gmail.com>
References: <42567e060510250147j582ce648p3ceef8e4376975be@mail.gmail.com>

Kishore B <kishorebh@gmail.com> writes:
>  Can you guys please take a look at the following query and let me know why
> the index is not considered in the plan?

"Considered" and "used" are two different things.

The two examples you give have the same estimated cost (within two
decimal places) so the planner sees no particular reason to choose one
over the other.

I surmise that you are testing on toy tables and extrapolating to what
will happen on larger tables.  This is an unjustified assumption.
Create a realistic test data set, ANALYZE it, and then see if the
planner chooses indexes you like.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <13279.1130247515@sss.pgh.pa.us>
Permalink:  ../13279.1130247515@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13279.1130247515@sss.pgh.pa.us

 · 

reply

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, kishorebh@gmail.com
  Subject: Re: Why Index is not working on date columns.
  In-Reply-To: <13279.1130247515@sss.pgh.pa.us>

* 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