Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)
Date: 2012-03-07 15:17:10
Message-ID: CA+U5nM+ivhd0RROU1jkxZp3Nj4YNdYybj=yQmXPh99t7+Vn4_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 7, 2012 at 3:04 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>> Just to keep things in perspective -- For a commit record to reach one
>> megabyte, it would have to be a transaction that drops over 43k tables.
>> Or have 64k smgr inval messages (for example, a TRUNCATE might send half
>> a dozen of these messages). Or have 262k subtransactions.  Or
>> combinations thereof.
>
>> Now admittedly, a page is only 8 kB, so for a commit record to be "many
>> pages long" (that is, >=3) it would require about 1500 smgr inval
>> messages, or, say, about 250 TRUNCATEs (of permanent tables with at
>> least one toastable field and at least one index).
>
> What about the locks (if running hot-standby)?

It's a list of active AccessExclusiveLocks. If that list is long you
can be sure not much else is happening on the server.

>> So they are undoubtely rare.  Not sure if as rare as Higgs bosons.
>
> Even if they're rare, having a major performance hiccup when one happens
> is not a side-effect I want to see from a patch whose only reason to
> exist is better performance.

I agree the effect you point out can exist, I just don't want to slow
down the main case as a result.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-03-07 15:26:43 Re: RFC: Making TRUNCATE more "MVCC-safe"
Previous Message Tom Lane 2012-03-07 15:04:19 Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)