Re: extending relations more efficiently - Mailing list pgsql-hackers

From Christopher Browne
Subject Re: extending relations more efficiently
Date
Msg-id CAFNqd5XKq0o8z5VBNa5NMp6KZwKvsC0SSeNyHJSTK=KWXpPdog@mail.gmail.com
Whole thread Raw
In response to Re: extending relations more efficiently  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: extending relations more efficiently
List pgsql-hackers
On Tue, May 1, 2012 at 10:22 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On Tue, May 1, 2012 at 3:08 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>
>> We've previously discussed the possible desirability of extending
>> relations in larger increments, rather than one block at a time, for
>> performance reasons.  I attempted to determine how much performance we
>> could possibly buy this way, and found that, as far as I can see, the
>> answer is, basically, none.
>
> Fair enough, but my understanding was that tests showed that the
> extension lock was a bottleneck, so doing extensions in larger chunks
> should reduce the time we spend waiting for a lock and thus improve
> performance. So while your results here show no gain, there is gain to
> be had elsewhere as a result.

Try to make sure that one of the scenarios involves there being
multiple writers.

One of the relevant cases is where there are multiple writers, where
they may wind up fighting over the last page in the table.  If free
space is in that one page, they might serialize on the request for
access to that page.

Extending by several pages at a time may help *one* of the writers,
but if that adds some I/O work that takes place while other
connections are blocked, waiting, then this might worsen things
somewhat for the other writers.  If this reduces the frequency of that
sort of collision, it might nonetheless be a win.
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem with multi-job pg_restore
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: additional error fields