Re: row filtering for logical replication

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Greg Nancarrow" <gregn4422(at)gmail(dot)com>
Cc: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com>, "Peter Smith" <smithpb2250(at)gmail(dot)com>, "Rahila Syed" <rahilasyed90(at)gmail(dot)com>, "Peter Eisentraut" <peter(dot)eisentraut(at)enterprisedb(dot)com>, Önder Kalacı <onderkalaci(at)gmail(dot)com>, japin <japinli(at)hotmail(dot)com>, "Michael Paquier" <michael(at)paquier(dot)xyz>, "David Steele" <david(at)pgmasters(dot)net>, "Craig Ringer" <craig(at)2ndquadrant(dot)com>, "Tomas Vondra" <tomas(dot)vondra(at)2ndquadrant(dot)com>, "Amit Langote" <amitlangote09(at)gmail(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: row filtering for logical replication
Date: 2021-07-08 00:33:41
Message-ID: f4a77a2b-1555-4e79-bc38-f13d59a7ac8b@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 7, 2021, at 2:24 AM, Greg Nancarrow wrote:
> I found that with the call to ExecInitExtraTupleSlot() in
> pgoutput_row_filter(), then the performance of pgoutput_row_filter()
> degrades considerably over the 100,000 invocations, and on my system
> it took about 43 seconds to filter and send to the subscriber.
> However, by caching the tuple table slot in RelationSyncEntry, this
> duration can be dramatically reduced by 38+ seconds.
> A further improvement can be made using this in combination with
> Peter's plan cache (v16-0004).
> I've attached a patch for this, which relies on the latest v16-0001
> and v16-0004 patches posted by Peter Smith (noting that v16-0001 is
> identical to your previously-posted 0001 patch).
> Also attached is a graph (created by Peter Smith – thanks!) detailing
> the performance improvement.
Greg, I like your suggestion and already integrate it (I replaced
ExecAllocTableSlot() with MakeSingleTupleTableSlot() because we don't need the
List). I'm still working on a new version to integrate all suggestions that you
and Peter did. I have a similar code to Peter's plan cache and I'm working on
merging both ideas together. I'm done for today but I'll continue tomorrow.

--
Euler Taveira
EDB https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2021-07-08 00:47:28 parse_subscription_options - suggested improvements
Previous Message Yugo NAGATA 2021-07-07 23:35:06 Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors