Re: Slow temporary tables when using sync rep

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Michael Nolan <htfoot(at)gmail(dot)com>
Cc: Thom Brown <thom(at)linux(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Slow temporary tables when using sync rep
Date: 2012-04-17 10:30:03
Message-ID: 4F8D462B.4080809@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17.04.2012 02:54, Michael Nolan wrote:
> On Mon, Apr 16, 2012 at 6:27 PM, Thom Brown<thom(at)linux(dot)com> wrote:
>
>> Hi,
>>
>> I've noticed that when using synchronous replication (on 9.2devel at
>> least), temporary tables become really slow:
>
> Since temporary tables are only present until the session ends (or
> possibly only until a commit), why are they replicated at all?

They're not replicated.

What happens is that we write the commit record if the transaction
accesses a temporary table, but we don't flush it. However, we still
wait until it's replicated to the standby. The obvious fix is to not
wait for that, see attached.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
temp-rel-syncrep-flush-1.patch text/x-diff 575 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2012-04-17 11:08:52 Re: [BUG] Checkpointer on hot standby runs without looking checkpoint_segments
Previous Message Greg Sabino Mullane 2012-04-17 10:25:09 Re: Last gasp