Re: Benchmarking partitioning triggers and rules - Mailing list pgsql-general

From Tomas Vondra
Subject Re: Benchmarking partitioning triggers and rules
Date
Msg-id 5500B6AE.1070903@2ndquadrant.com
Whole thread Raw
In response to Re: Benchmarking partitioning triggers and rules  (Tim Uckun <timuckun@gmail.com>)
Responses Re: Benchmarking partitioning triggers and rules
List pgsql-general
On 11.3.2015 21:43, Tim Uckun wrote:
> Hey I hate to bump my post but I would really appreciate some input
> on this benchmark. I am very alarmed that adding a very simple
> partitioning trigger slows the insert speed by an order of magnitude.
> Is there any way to speed this up?

I think to actually give you a meaningful response, we really need more
details about your configuration - what PostgreSQL version are you
using, what configuration have you changed from the defaults and such.

Anyway, you're right that triggers are not cheap. The numbers I get on
the development version with a bit of tuning look like this:

INSERT (direct)    1.5 sec
INSERT             4.0 sec
INSERT (EXECUTE)  11.5 sec

So it's ~ what you've measured. Rules have the lowest overhead, but also
there's a lot of tricky places.

There's not much you can do, except for inserting the data directly into
the right partition (without any triggers).


--
Tomas Vondra                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-general by date:

Previous
From: Michael Nolan
Date:
Subject: Re: PostgreSQL-related legal question
Next
From: Brent Tubbs
Date:
Subject: Re: Postgres and data warehouses