From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pgsql: Compute XID horizon for page level index vacuum on primary.
Date: Mon, 1 Apr 2019 18:26:59 -0700
Message-ID: <20190402012659.4znhbisezbm7juvf@alap3.anarazel.de> (raw)
In-Reply-To: <CA+TgmoZP-CTmEPZdmqEOb+6t_Tts2nuF7eoqxxvXEHaUoBDmsw@mail.gmail.com>
References: <E1h8w5d-0006c7-16@gemulon.postgresql.org>
<CA+hUKGLCwPF0S4Mk7S8qw+DK0Bq65LueN9rofAA3HHSYikW-Zw@mail.gmail.com>
<20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de>
<CAH2-WznJkQaeVX-ZADp-X6spy2Kz4XUr5GHyZwxmxw-EUocj5A@mail.gmail.com>
<DB9129B1-D730-4FA2-824D-471DA0F57399@anarazel.de>
<CA+hUKGJ1NA0zoB5PTaxLg_FM1S0FVkdbFxjGiYa+syp48g9=mQ@mail.gmail.com>
<CA+TgmoZP-CTmEPZdmqEOb+6t_Tts2nuF7eoqxxvXEHaUoBDmsw@mail.gmail.com>
Hi,
On 2019-03-30 11:44:36 -0400, Robert Haas wrote:
> On Sat, Mar 30, 2019 at 6:33 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> > I didn't understand that last sentence.
> >
> > Here's an attempt to write a suitable comment for the quick fix. And
> > I suppose effective_io_concurrency is a reasonable default.
> >
> > It's pretty hard to think of a good way to get your hands on the real
> > value safely from here. I wondered if there was a way to narrow this
> > to just GLOBALTABLESPACE_OID since that's where pg_tablespace lives,
> > but that doesn't work, we access other catalog too in that path.
> >
> > Hmm, it seems a bit odd that 0 is supposed to mean "disable issuance
> > of asynchronous I/O requests" according to config.sgml, but here 0
> > will prefetch 10 buffers.
>
> Mmmph. I'm starting to think we're not going to get a satisfactory
> result here unless we make this controlled by something other than
> effective_io_concurrency. There's just no reason to suppose that the
> same setting that we use to control prefetching for bitmap index scans
> is also going to be right for what's basically a bulk operation.
>
> Interestingly, Dilip Kumar ran into similar issues recently while
> working on bulk processing for undo records for zheap. In that case,
> you definitely want to prefetch the undo aggressively, because you're
> reading it front to back and backwards scans suck without prefetching.
> And you possibly also want to prefetch the data pages to which the
> undo that you are prefetching applies, but maybe not as aggressively
> because you're going to be doing a WAL write for each data page and
> flooding the system with too many reads could be counterproductive, at
> least if pg_wal and the rest of $PGDATA are not on separate spindles.
> And even if they are, it's possible that as you suck in undo pages and
> the zheap pages that they need to update, you might evict dirty pages,
> generating write activity against the data directory.
I'm not yet convinced it's necessary to create a new GUC, but also not
strongly opposed. I've created an open items issue for it, so we don't
forget.
> Overall I'm inclined to think that we're making the same mistake here
> that we did with work_mem, namely, assuming that you can control a
> bunch of different prefetching behaviors with a single GUC and things
> will be OK. Let's just create a new GUC for this and default it to 10
> or something and go home.
I agree that we needed to split work_mem, but a) that was far less clear
for many years b) there was no logic ot use more work_mem in
maintenance-y cases...
Greetings,
Andres Freund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de, robertmhaas@gmail.com, thomas.munro@gmail.com, pg@bowt.ie, pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Compute XID horizon for page level index vacuum on primary.
In-Reply-To: <20190402012659.4znhbisezbm7juvf@alap3.anarazel.de>
References: <E1h8w5d-0006c7-16@gemulon.postgresql.org> <CA+hUKGLCwPF0S4Mk7S8qw+DK0Bq65LueN9rofAA3HHSYikW-Zw@mail.gmail.com> <20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de> <CAH2-WznJkQaeVX-ZADp-X6spy2Kz4XUr5GHyZwxmxw-EUocj5A@mail.gmail.com> <DB9129B1-D730-4FA2-824D-471DA0F57399@anarazel.de> <CA+hUKGJ1NA0zoB5PTaxLg_FM1S0FVkdbFxjGiYa+syp48g9=mQ@mail.gmail.com> <CA+TgmoZP-CTmEPZdmqEOb+6t_Tts2nuF7eoqxxvXEHaUoBDmsw@mail.gmail.com> <20190402012659.4znhbisezbm7juvf@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox