Search Postgresql Archives

Re: check constraint question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Tim Rupp" <caphrim007@xxxxxxxxx> writes:

> where start_time >= '2008-01-01'::date AND start_time < '2008-01-10'::date
>
> should give the same rows as
>
> where start_time >= '2008-01-01'::date AND end_time <= '2008-01-09'::date

I think you'll need to do the same thing to the constraints as well. You'll
probably want four clauses on your constraints:

start_time >= ... and start_time <= ... and end_time >= ... and end_time <= ...

(or BETWEEN which is equivalent)

Then you could include start_time and/or end_time ranges in your where clause
and the planner would prune partitions using both ranges.



-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux