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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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