Re: bad COPY performance with NOTIFY in a trigger

From: Harald Fuchs <hari(dot)fuchs(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: bad COPY performance with NOTIFY in a trigger
Date: 2016-02-05 08:40:44
Message-ID: 87fux77do3.fsf@hf.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> No surprise, see AsyncExistsPendingNotify. You would have a lot of other
> performance issues with sending hundreds of thousands of distinct notify
> events from one transaction anyway, so I can't get terribly excited about
> this.

@Filip: you probably want a per-statement trigger rather than a per-row
trigger: insert all rows with COPY, then send one notification.

You have to mark the new rows somehow yourself; unfortunately PostgreSQL
has no way to tell them in a statement trigger.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Marc Mamin 2016-02-05 11:28:08 gin performance issue.
Previous Message Tom Lane 2016-02-04 22:41:13 Re: bad COPY performance with NOTIFY in a trigger