Re: Constraint exclusion

From: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "'PostgreSQL SQL List'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Constraint exclusion
Date: 2007-06-21 22:00:45
Message-ID: 041a01c7b44f$a0a459d0$8f01010a@iptel.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda pgsql-sql

I see. Thanks for the tip.

Regards,
Fernando.

-----Mensaje original-----
De: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Enviado el: Miércoles, 20 de Junio de 2007 19:37
Para: Fernando Hevia
CC: 'PostgreSQL SQL List'
Asunto: Re: [SQL] Constraint exclusion

"Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar> writes:
> -- Constraints: one partition per month
> ALTER TABLE table_p01 ADD CONSTRAINT chk_table_p01_setuptime CHECK
> (EXTRACT(MONTH FROM setuptime) = 1::DOUBLE PRECISION);

The planner is not able to do anything with these constraints, other
than if there is an exact match to them in the query WHERE, which
there is not. Try simple range constraints on the column, instead.
The system does know about inferences like "colx <= const1 must
imply colx <= const2 if const1 <= const2". It does not know how
to reason about extract().

regards, tom lane

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Mario Wojcik 2007-06-21 22:06:34 Re: [pgsql-es-ayuda] Re: OT programa o controlador que detecte número de teléfono
Previous Message Andres Manuel Salvador Garcia 2007-06-21 20:08:06 Re: OT programa o controlador que detecte número de teléfono

Browse pgsql-sql by date

  From Date Subject
Next Message Bart Degryse 2007-06-22 12:50:37 Transactions and Exceptions
Previous Message Ragnar 2007-06-21 18:43:00 Re: join problem