Partitioning and constraint exclusion

From: Sylvain Rabot <sylvain(at)abstraction(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: Partitioning and constraint exclusion
Date: 2011-06-21 15:58:20
Message-ID: BANLkTikYQXH8GQbnswrJpOEKFfR7b3i8qg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi list,

I'm trying to do some partitioning on a table but I have a problem
with constraint exclusion.

Here the following code : https://gist.github.com/1038133

(this code is just an example to explain the problem)

As you can see I declare a fake immutable function in order to make
constraint exclusion work even
if the function is not immutable at all.

On Postgres 9.1beta2 when i run this code the first select will use
contraint exclusion but the second will not.
This apparently has something to do with the size of the array
returned by the fake immutable function.

Is there a way to force the use of constraint exclusion no matter the
size of the array used in the check constraint ?

Regards.

--
Sylvain

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-06-21 16:07:51 Re: LISTEN filtering
Previous Message Greg Sabino Mullane 2011-06-21 15:58:18 LISTEN filtering