Re: constraint checking on partitions

From: "Chris Spotts" <rfusca(at)gmail(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "'postgres list'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: constraint checking on partitions
Date: 2009-07-09 19:45:08
Message-ID: 00bb01ca00cd$c4bb10d0$4e313270$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> > If I ran a select * from A where date1 >= '2009-07-02' and date1 <
> > '2009-07-15' then I would think it wouldn't check O.
>
[Spotts, Christopher]
I oversimplified this too much - but I figured out what was happening.
If you added the June table as well and added a separate NOT constraint for
June, and then wrote the query
"SELECT * from A where date1 >= '2009-06-01' and date1 < '2009-07-05'" the
planner can't match them to individual constraints, so it doesn't exclude.
Theoretically the planner could logically "AND" them together to get better
exclusion, but it must not be.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2009-07-09 20:05:13 Re: Overhead of union versus union all
Previous Message Tom Lane 2009-07-09 19:09:04 Re: constraint checking on partitions