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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Jarvis <thangalin(at)gmail(dot)com>
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:03:54
Message-ID: 7917.1274385834@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
David Jarvis <thangalin(at)gmail(dot)com> writes:
> 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

I think what you're essentially describing here is removing the OR from
the query in favor of issuing two queries and then combining the results
in the app.  Yeah, you could do that, but one would hope that it isn't
faster ;-)

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: David JarvisDate: 2010-05-20 20:09:05
Subject: Re: Optimize date query for large child tables: GiST or GIN?
Previous:From: David JarvisDate: 2010-05-20 19:58:16
Subject: Re: Optimize date query for large child tables: GiST or GIN?

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