Skip site navigation (1) Skip section navigation (2)

Re: Why Index is not working on date columns.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kishore B <kishorebh(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Why Index is not working on date columns.
Date: 2005-10-25 13:38:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Kishore B <kishorebh(at)gmail(dot)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

In response to


pgsql-performance by date

Next:From: Markus WollnyDate: 2005-10-25 13:39:42
Subject: Re: Strange planner decision on quite simple select
Previous:From: Rich DoughtyDate: 2005-10-25 11:35:06
Subject: Outer join query plans and performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group