Jan Wieck JanWieck
Tue Nov 2 22:19:28 PST 2004
On 11/2/2004 11:35 AM, Ed L. wrote:

> On Tuesday November 2 2004 6:15, Jan Wieck wrote:
>> On 11/2/2004 1:08 AM, Ed L. wrote:
>> > I have a 2-node master-slave replication set up with 1.0.5.  It's been
>> > running for a couple days.  The sl_seqlog table is now 75MB.  Is this
>> > expected?  How much larger will it grow?  What causes it to get cleaned
>> > up?
>>
>> Don't take this wrong, Ed, it is certainly appreciated to point out
>> possible problems with Slony. But maybe you could direct a little bit of
 >> [...]
> 
> Don't take this wrong, Jan, your Slony work is certainly much appreciated.  
> But maybe you could direct a little bit of the energy you spend on cheap 

Ain't a little bit of a breeze refreshing? :-)

I've looked at all the code in question. And you also got already an 
answer from Tom Lane on sequence triggers. I don't think to overstate it 
when saying that it's next to impossible to get sequence triggers into 
any existing PostgreSQL release.

What the code currently does is to select all replicated sequences last 
values through a view that calls a PL/pgSQL function that uses EXECUTE. 
We should probably do better than that. Since triggers are out of 
question, the only way to speed this up is doing it with a per-sequence 
prepared SPI plan (unless we want to reach into the SPI plan itself). 
The cleanest way would be, to replace the PL/pgSQL function that does 
the EXECUTE with a C function that cashes the plans.

As an optimization, that function could also remember the last value and 
return NULL if it didn't change. The event creation function, that 
actually inserts the sl_seqlog rows coming out of that view can easily 
filter them out, so that the ones unchanged don't get updated on the 
replica over and over again.

Who's up for coding that?


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #


More information about the Slony1-general mailing list