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 20:30:48
Message-ID: AANLkTikK_xUrI7iOU9CzpYAKbtxZz-chc3SaHGhTEGXP@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

The greatest() expression reduces to either the current year (year + 0) or
the next year (year + 1) by taking the sign of the difference in start/end
days. This allows me to derive an end date, such as:

Dec 22, 1900 to Mar 22, 1901

Then I check if the measured date falls between those two dates.

The expression might not be correct as I'm still quite new to PostgreSQL's
syntax.

Dave

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephen Frost 2010-05-20 21:01:06 Re: Optimize date query for large child tables: GiST or GIN?
Previous Message David Jarvis 2010-05-20 20:19:25 Re: Optimize date query for large child tables: GiST or GIN?