Skip site navigation (1) Skip section navigation (2)

XLogInsert

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: XLogInsert
Date: 2009-08-19 16:14:08
Message-ID: f67928030908190914g60397727s5a685636ac73a3f7@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
In XLogInsert (src/backend/access/transam/xlog.c), the part that adds back-up
blocks into the rdata chain is described:

        /*
         * Make additional rdata chain entries for the backup blocks, so that we
         * don't need to special-case them in the write loop.  Note that we have
         * now irrevocably changed the input rdata chain.

If I read the code correctly, the only thing that is irrevocable is
that it writes into
rdt->next, and if it saved an old copy of rdt first, then it could
revoke the changes just
by doing rdt_old->next=NULL.  If that were done, then I think this
code could be
moved out of the section holding the WALInsertLock.  It could probably be folded
into the part of the code that computes the CRC.

I don't think this wold be a big performance win, as that part of the
code is pretty
fast, but every bit helps in a highly contended lock, and I think the code
would be simpler as well.  Do you think it would be worth me giving this a try?

Cheers,

Jeff

Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2009-08-19 16:19:53
Subject: Re: alpha1 bundled -- please verify
Previous:From: Tom LaneDate: 2009-08-19 16:13:22
Subject: Re: explain root element for auto-explain

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group