Skip site navigation (1) Skip section navigation (2)

Re: Partitioning and constraint exclusion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sylvain Rabot <sylvain(at)abstraction(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Partitioning and constraint exclusion
Date: 2011-06-21 16:25:19
Message-ID: 25017.1308673519@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
Sylvain Rabot <sylvain(at)abstraction(dot)fr> writes:
> 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.

See predtest.c:

/*
 * Proof attempts involving large arrays in ScalarArrayOpExpr nodes are
 * likely to require O(N^2) time, and more often than not fail anyway.
 * So we set an arbitrary limit on the number of array elements that
 * we will allow to be treated as an AND or OR clause.
 * XXX is it worth exposing this as a GUC knob?
 */
#define MAX_SAOP_ARRAY_SIZE		100

While you could possibly increase that, I think that your approach is
bound to have terrible performance anyway.

			regards, tom lane

In response to

Responses

pgsql-general by date

Next:From: C├ędric VillemainDate: 2011-06-21 17:00:30
Subject: Re: PostgreSQL 8.4.8 bringing my website down every evening
Previous:From: Tom LaneDate: 2011-06-21 16:07:51
Subject: Re: LISTEN filtering

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group