pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fernando Hevia <fhevia@ip-tel.com.ar>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: 'PostgreSQL SQL List' <pgsql-sql@postgresql.org>
Subject: Re: Constraint exclusion
Date: Thu, 21 Jun 2007 19:00:45 -0300
Message-ID: <041a01c7b44f$a0a459d0$8f01010a@iptel.com.ar> (raw)
In-Reply-To: <3618.1182379001@sss.pgh.pa.us>

I see. Thanks for the tip.

Regards,
Fernando.

-----Mensaje original-----
De: Tom Lane [mailto:tgl@sss.pgh.pa.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@ip-tel.com.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




view thread (3+ messages)

Message-ID: <041a01c7b44f$a0a459d0$8f01010a@iptel.com.ar>
Permalink:  ../041a01c7b44f$a0a459d0$8f01010a@iptel.com.ar/
Also on:    postgresql.org/message-id/041a01c7b44f$a0a459d0$8f01010a@iptel.com.ar

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fhevia@ip-tel.com.ar, tgl@sss.pgh.pa.us
  Subject: Re: Constraint exclusion
  In-Reply-To: <041a01c7b44f$a0a459d0$8f01010a@iptel.com.ar>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox