Re: Speeding up INSERTs and UPDATEs to partitioned tables

From: Krzysztof Nienartowicz <krzysztof(dot)nienartowicz(at)gmail(dot)com>
To: david(dot)rowley(at)2ndquadrant(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Speeding up INSERTs and UPDATEs to partitioned tables
Date: 2018-10-22 22:55:56
Message-ID: CABY7=+5=hcL255peBiO1rmcf_MOqywyCV4uUwSPyE5TcsZpObA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In the end we hacked the code to re-enable triggers on partitioned
tables and switch off native insert code on partitioned tables. Quite
hackish and would be nice to have it fixed in a more natural manner.
Yes, it looked like locking but not only -
ExecSetupPartitionTupleRouting: ExecOpenIndices/find_all_inheritors
looked like dominant and also convert_tuples_by_name but not sure if
the last one was not an artifact of perf sampling.
Will check the patch 0001, thanks.

On Tue, Oct 23, 2018 at 12:36 AM David Rowley
<david(dot)rowley(at)2ndquadrant(dot)com> wrote:
>
> On 15 October 2018 at 23:04, Krzysztof Nienartowicz
> <krzysztof(dot)nienartowicz(at)gmail(dot)com> wrote:
> > We see quite prohibitive 5-6x slowdown with native partitioning on in
> > comparison to trigger based in PG9.5.
> > This is clearly visible with highly parallel inserts (Can share
> > flamediagrams comparing the two).
>
> Does the 0001 patch here fix the problem? I imagined that it would be
> the locking of all partitions that would have killed the performance.
>
> > This basically excludes native partitioning from being used by us. Do you
> > think your changes could be backported to PG10? - we checked and this would
> > need quite a number of changes but given the weight of this change maybe it
> > could be considered?
>
> It's very unlikely to happen, especially so with the 0002 patch, which
> I've so far just attached as a demonstration of where the performance
> could end up.
>
> --
> David Rowley http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-10-22 23:31:21 Re: Function to promote standby servers
Previous Message Michael Paquier 2018-10-22 22:47:30 Re: Multiple Wait Events for extensions