Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDJOn-0006zR-3P for pgsql-committers@arkaria.postgresql.org; Wed, 15 Jun 2016 22:35:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bDJOm-0007Pf-Hg for pgsql-committers@arkaria.postgresql.org; Wed, 15 Jun 2016 22:35:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bDJOY-0006yx-G6; Wed, 15 Jun 2016 22:34:46 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bDJOV-000859-O4; Wed, 15 Jun 2016 22:34:45 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 03436206F1; Wed, 15 Jun 2016 18:34:41 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Wed, 15 Jun 2016 18:34:42 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=E4FytAK1/NAhFSAmnvcT4/QZBXU=; b=K7okQ UzSKgjYKyoiOweoXkecLpwYIda6ZbJe05otpcnwnSECetspwqN7/YRyAl/jJK9sS hWwyvJUe8EiUbN/wyoJ4rGUqfN8pNrPPdhYaPCvXDpoT3Av51s+sOiLZxyDUt4FK gjL5T+oeYIHGkqt3JvuSJEekOIJQfcLQDbv3eg= X-Sasl-enc: XdqNEVO/G0FXCWA7kgCrxVQRQ0wuHjaQ3EqkkE4R5Lxk 1466030081 Received: from intern.anarazel.de (somacentral1.static.monkeybrains.net [162.217.75.74]) by mail.messagingengine.com (Postfix) with ESMTPA id 93727CCDA1; Wed, 15 Jun 2016 18:34:41 -0400 (EDT) Date: Wed, 15 Jun 2016 15:34:40 -0700 From: Andres Freund To: Kevin Grittner Cc: Robert Haas , Alvaro Herrera , Ants Aasma , Amit Kapila , Noah Misch , Kevin Grittner , "pgsql-hackers@postgresql.org" , "pgsql-committers@postgresql.org" Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < Message-ID: <20160615223440.omhksf4senwtfc6q@alap3.anarazel.de> References: <20160615184537.GA20738@alvherre.pgsql> <20160615192011.eicg7hwkndyx2cmo@alap3.anarazel.de> <20160615202552.32oc3y3zzd5pukbp@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 2016-06-15 16:58:25 -0500, Kevin Grittner wrote: > On Wed, Jun 15, 2016 at 3:25 PM, Andres Freund wrote: > > On 2016-06-15 14:24:58 -0500, Kevin Grittner wrote: > >> On Wed, Jun 15, 2016 at 2:20 PM, Andres Freund wrote: > >> > >> > We might fetch a toast tuple which > >> > since have been re-purposed for a datum of a different type. > >> > >> How would that happen? > > > > Autovac vacuums toast and heap tables independently. Once a toast datum > > isn't used anymore, the oid used can be reused (because it doesn't > > conflict via GetNewOidWithIndex() anymore. If analyze then detoasts a > > datum, which hasn't been removed, the contents of that toast id, might > > actually be for something different. > > What prevents that from happening now, without STO? Afaics we shouldn't ever look (i.e. detoast) at a "dead for everyone" tuple in autovacuum (or anywhere else). There's one minor exception to that, and that's enum datums in indexes, which is why we currently have weird transactional requirements for them. I'm not entirely sure this can be hit, but it's worth checking. Andres -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers