Re: BUG #8470: 9.3 locking/subtransaction performance regression

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: os(at)ohmu(dot)fi
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8470: 9.3 locking/subtransaction performance regression
Date: 2013-12-20 20:47:53
Message-ID: 20131220204753.GG22570@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> Removing the BEGIN/EXCEPTION/END block and just doing a 'SELECT FOR UPDATE'
> for a suitable row is significantly slower in 9.3.0 (314.765 ms vs 118.894
> ms on 9.2.4). A 'SELECT' without a FOR UPDATE and BEGIN/EXCEPTION/END has
> the same performance on 9.2.4 and 9.3.0.

I have come up with the attached patch. As far as I can tell it
restores performance roughly to the level of 9.2 for this test case;
could you please try it out and see if it fixes things for you? It'd be
particularly good if you can check not only the test case you submitted
but also the one that made you explore this in the first place.

I haven't pushed it yet because I haven't yet convinced myself that this
is safe, but my intention is to do it shortly so that it will be in
9.3.3.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
optimize-multi-locks.patch text/x-diff 4.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message cbfgterfdy 2013-12-20 21:12:11 Re: BUG #8662: psql -H and ts_headline
Previous Message Andres Freund 2013-12-20 20:09:31 Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages