Partitioning and constraint exclusion - Mailing list pgsql-general

From Sylvain Rabot
Subject Partitioning and constraint exclusion
Date
Msg-id BANLkTikYQXH8GQbnswrJpOEKFfR7b3i8qg@mail.gmail.com
Whole thread Raw
Responses Re: Partitioning and constraint exclusion
List 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

pgsql-general by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: LISTEN filtering
Next
From: Tom Lane
Date:
Subject: Re: LISTEN filtering