Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB8Cj-0007Vl-1K for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2019 01:27:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hB8Cg-0007xZ-Gy for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2019 01:27:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB8Cg-0007xS-4k for pgsql-hackers@lists.postgresql.org; Tue, 02 Apr 2019 01:27:06 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB8Cd-00034Y-KW for pgsql-hackers@lists.postgresql.org; Tue, 02 Apr 2019 01:27:04 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 085F3221C6; Mon, 1 Apr 2019 21:27:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 01 Apr 2019 21:27:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=ou4xPy4WODJLvPdtYzKQ3Awmdb7 wpKrBdWHKSoQnnsc=; b=DO3gP+mWqZQTD5GWv2JWP6k3IuV50/5E/8savrh7K88 LpF0NkJx8uxupnD3oPMy3Uu1skRwk1hPGVeaAol0dgsZ0qkpIV6tsAyCBHGFHhwf XMXp6BQyfRoAGw8jWsnwkETtTvBL1mRpb/7CBJZQVaeav1LCJBDBA9o0YSvxitFC uHRY6i7sWVT+27tHtZ1n3nYk/+usX+y/kF7QbkrqzsPTEXHqR4YgFuIgQuzxlgBT OUDhUhRAtRpnjCih3lYf6XwNV68zwSenN2Hcr+/oToCuYcbnMIcSNdCAnR6lR58n uZAvr0y1FCxq43pOMc7+GQISKVVz7mFKtYStxrlkx4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ou4xPy 4WODJLvPdtYzKQ3Awmdb7wpKrBdWHKSoQnnsc=; b=lgpVRVjX7UMr0aMYJp7jHC 2DvjR5Dt23W5c1l06jbRRg2lx5Q5FkNyW7rVYDUHhhmkjyMl+D+lJlHxXqEEJ01g AdCcRluQ57r8Fo7LxBYrXKuOD9seikUvacYWLFva3NukGsxoMmFp96SAXcZmStYI ZkmQ5SbVtjvdqpIukM+VL+co+Oq/91+8dWKqam6EQM7NMc69HZCM4OWU5AvjQm7D mjDn6jmkA/YRg2r+KQIJBe2l8RUusm/Aqn3S/84csdQSM4g/D5N1p66Xj9P0rANQ Wy+870hf5HWI6nvVhTFkyaBXZ4gNDrjgcPGgS9W5zFMSIXXAB9CC48r3Z0rcKCcw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrleehgdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecukfhppeelke drvddutddrudegtddrudejudenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghs segrnhgrrhgriigvlhdruggvnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 165F0E442F; Mon, 1 Apr 2019 21:27:01 -0400 (EDT) Date: Mon, 1 Apr 2019 18:26:59 -0700 From: Andres Freund To: Robert Haas Cc: Thomas Munro , Peter Geoghegan , PostgreSQL Hackers Subject: Re: pgsql: Compute XID horizon for page level index vacuum on primary. Message-ID: <20190402012659.4znhbisezbm7juvf@alap3.anarazel.de> References: <20190328122847.ci7nmnook2dlbbqv@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-03-30 11:44:36 -0400, Robert Haas wrote: > On Sat, Mar 30, 2019 at 6:33 AM Thomas Munro 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