Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-08 Thread Merlin Moncure
On Sat, Feb 6, 2016 at 6:03 AM, Filip Rembiałkowski wrote: > Thanks for the feedback. > > This patch is my first and obvious approach. > > @Merlin, I'm not sure if I get your idea: > - keep previous behaviour as obligatory? (which is: automatic > de-duplicating of

Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-08 Thread Merlin Moncure
On Mon, Feb 8, 2016 at 8:35 AM, Merlin Moncure wrote: > On Sat, Feb 6, 2016 at 6:03 AM, Filip Rembiałkowski > wrote: >> Thanks for the feedback. >> >> This patch is my first and obvious approach. >> >> @Merlin, I'm not sure if I get your idea:

Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-06 Thread Filip Rembiałkowski
Thanks for the feedback. This patch is my first and obvious approach. @Merlin, I'm not sure if I get your idea: - keep previous behaviour as obligatory? (which is: automatic de-duplicating of incoming messages by channel+payload), - instead of trivial search (sorting by browsing) use some kind

Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-05 Thread Filip Rembiałkowski
patch submitted on -hackers list. http://www.postgresql.org/message-id/CAP_rwwn2z0gPOn8GuQ3qDVS5+HgEcG2EzEOyiJtcA=vpdeh...@mail.gmail.com results after the patch: trigger= BEGIN RETURN NULL; END rows=4 228ms COPY test.tab FROM '/tmp/test.dat' 205ms COPY test.tab FROM

Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-05 Thread Harald Fuchs
Tom Lane 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

Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-05 Thread Merlin Moncure
On Fri, Feb 5, 2016 at 9:33 AM, Filip Rembiałkowski wrote: > patch submitted on -hackers list. > http://www.postgresql.org/message-id/CAP_rwwn2z0gPOn8GuQ3qDVS5+HgEcG2EzEOyiJtcA=vpdeh...@mail.gmail.com > > results after the patch: > > trigger= BEGIN RETURN NULL; END

Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-05 Thread Filip Rembiałkowski
On Thu, Feb 4, 2016 at 11:41 PM, Tom Lane wrote: > =?UTF-8?Q?Filip_Rembia=C5=82kowski?= > writes: > > A table has a trigger. > > The trigger sends a NOTIFY. > > Test with COPY FROM shows non-linear correlation between number of > inserted > >

Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-04 Thread Tom Lane
=?UTF-8?Q?Filip_Rembia=C5=82kowski?= writes: > A table has a trigger. > The trigger sends a NOTIFY. > Test with COPY FROM shows non-linear correlation between number of inserted > rows and COPY duration. No surprise, see AsyncExistsPendingNotify. You would have a

[PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-04 Thread Filip Rembiałkowski
Hi. A table has a trigger. The trigger sends a NOTIFY. Test with COPY FROM shows non-linear correlation between number of inserted rows and COPY duration. Table "test.tab" Column | Type | Modifiers