> 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