Re: Enabling constraint_exclusion does not avoid scanning all child partitions - Mailing list pgsql-performance

From Fayza Sultan
Subject Re: Enabling constraint_exclusion does not avoid scanning all child partitions
Date
Msg-id 38443e510612031437h30337dejc928f059fb5fa79c@mail.gmail.com
Whole thread Raw
In response to Re: Enabling constraint_exclusion does not avoid scanning all child partitions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Your point solved my problem.
 
Thank you
 
-Fayza

 
On 12/4/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Fayza Sultan" <fayza.sultan@gmail.com> writes:
> CREATE TABLE parent (
>     monthdate date NOT NULL,
>     id int4 NOT NULL,
>     CONSTRAINT parent_idx PRIMARY KEY (monthdate,id )
> );

> CREATE TABLE child1
> (
> CONSTRAINT child1_idx PRIMARY KEY (monthdate,id),
> CONSTRAINT child1_chk CHECK (monthdate >= '2006-01-01 00:00:00'::timestamp
> without time zone AND monthdate < '2006-02-01 00:00:00'::timestamp without
> time zone)

monthdate is date, not timestamp.  See the caveat in the documentation
about avoiding cross-type comparisons when formulating constraints for
constraint exclusion to use.

                       regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Enabling constraint_exclusion does not avoid scanning all child partitions
Next
From: "Carlo Stonebanks"
Date:
Subject: Is Vacuum/analyze destroying my performance?