Re: different behaviour between select and delete when constraint_exclusion = partition

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marc Cousin <cousinmarc(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: different behaviour between select and delete when constraint_exclusion = partition
Date: 2010-03-30 14:34:28
Message-ID: 16690.1269959668@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marc Cousin <cousinmarc(at)gmail(dot)com> writes:
> Anyway here is the problem : when using constraint_exclusion=partition, a
> delete query scans all partitions, when the same query rewritten as a select
> is removing partitions as expected. When constraint_exclusion=on, the
> partition removal works as expected with the delete too. I've tested it on 8.4
> and 9.0

Hmm, this seems like a shortcoming in the constraint_exclusion=partition
feature. The reason it doesn't work is that inheritance expansion of a
DELETE/UPDATE target rel is handled entirely differently from expansion
of a SELECT source. But it seems like it would be desirable if it did
work.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2010-03-30 14:47:59 Re: createuser: could not connect to database postgres: FATAL: password authentication failed for user "postgres"
Previous Message Merlin Moncure 2010-03-30 14:22:07 Re: Processor speed relative to postgres transactions per second