Re: Optimize date query for large child tables: GiST or GIN?

From: David Jarvis <thangalin(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thom Brown <thombrown(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimize date query for large child tables: GiST or GIN?
Date: 2010-05-20 19:58:16
Message-ID: AANLkTikOEC-Gr3eqGlyGauRAZJknQEaS5DEWw-ZOcl6r@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

What if I were to have the application pass in two sets of date ranges?

For the condition of Dec 22 to Mar 22:

Dec 22 would become:

- Dec 22 - Dec 31

Mar 22 would become:

- Jan 1 - Mar 22

The first range would always be for the current year; the second range would
always be for the year following the current year.

Would that allow PostgreSQL to use the index?

Dave

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2010-05-20 20:03:54 Re: Optimize date query for large child tables: GiST or GIN?
Previous Message Tom Lane 2010-05-20 19:52:50 Re: Optimize date query for large child tables: GiST or GIN?