Re: Needless additional partition check in INSERT?

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>
Subject: Re: Needless additional partition check in INSERT?
Date: 2018-06-08 16:52:47
Message-ID: 20180608165247.cu72uc2iyphnz3k2@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Jun-09, David Rowley wrote:

> On 9 June 2018 at 03:24, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> > I was also wondering about introducing a new function call in this path
> > where previously was none. Given the amount of other stuff that's
> > happening when a tuple is inserted, I suppose it's not worth worrying
> > about in terms of making this an inline function in the header.
>
> I wondered about that too. I've not tested it again, but I do have
> another patch locally which can about double the speed of COPY FROM
> for partitioned tables, so I have to admit I did gawk at the
> additional function call idea, but I'd rather see this fixed than on
> the shelf, so I went with it.
>
> I'll leave it up to you to how you'd like to format the if statement.
> I've written it the way I'm happy with.

Truth is, the more I look at this, the more I think it should be done in
the way Amit Langote was proposing: do away with the extra function, and
check all those conditions inside ExecConstraints itself. We can add a
new boolean tupleRouting argument, which I think is the only missing bit.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-06-08 16:57:39 Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian
Previous Message Melanie Plageman 2018-06-08 16:51:37 Re: Bug in either collation docs or code