Re: Why Index is not working on date columns. - Mailing list pgsql-performance

From Tom Lane
Subject Re: Why Index is not working on date columns.
Date
Msg-id 13279.1130247515@sss.pgh.pa.us
Whole thread Raw
In response to Why Index is not working on date columns.  (Kishore B <kishorebh@gmail.com>)
Responses Re: Why Index is not working on date columns.
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Rich Doughty
Date:
Subject: Outer join query plans and performance
Next
From: "Markus Wollny"
Date:
Subject: Re: Strange planner decision on quite simple select