Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5Gpu-0003pH-JY for pgsql-committers@arkaria.postgresql.org; Tue, 24 May 2016 18:13:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b5Gpu-0000MD-6N for pgsql-committers@arkaria.postgresql.org; Tue, 24 May 2016 18:13:46 +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 1b5Gpg-0007qT-Bi; Tue, 24 May 2016 18:13:32 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5Gpd-0003GD-KP; Tue, 24 May 2016 18:13:31 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0208B20706; Tue, 24 May 2016 14:13:27 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Tue, 24 May 2016 14:13:28 -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=Da4YfJXQD0+X1AiQxHAeHlYDU5U=; b=WDPtO P9L5WdiAs5PmfbvijbA7OHX6Mkx2qbC+Rg4mfn91OwRm+LQGL1R+SIGyPYFnieWN rkqPWrpBrT+HNEdOeuMOLRLKvfeQAa1fzb5fQGbTAh9D0hmzCo9v+xc48wFETvZM KR2Q5+iMGzahJPYNFb1E0ix0KNJniGqFwElxLA= X-Sasl-enc: NRJFtrm0TeunHT1xPVC+ASZTbxeYKRUL89tKNbs4w5OL 1464113607 Received: from intern.anarazel.de (somacentral.static.monkeybrains.net [162.217.75.74]) by mail.messagingengine.com (Postfix) with ESMTPA id AB268F2A01; Tue, 24 May 2016 14:13:27 -0400 (EDT) Date: Tue, 24 May 2016 11:13:24 -0700 From: Andres Freund To: Kevin Grittner Cc: Ants Aasma , Amit Kapila , Noah Misch , Robert Haas , 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: <20160524181324.lynifdkonl6ssegs@alap3.anarazel.de> References: <171569342.34745.1461078735421@RIA> <20160506220728.bgyxet73t6s3hjiw@alap3.anarazel.de> <20160507004844.wbze4nhjqa67io2a@alap3.anarazel.de> <20160524170058.6fhenruilde4xza4@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-05-24 13:04:09 -0500, Kevin Grittner wrote: > On Tue, May 24, 2016 at 12:00 PM, Andres Freund wrote: > > > Analyze IIRC acquires a new snapshot when getting sample rows, > > I could not find anything like that, and a case-insensitive search > of analyze.c finds no occurrences of "snap". Can you remember > where you think you saw something that would cause the ANALYZE > command in my test to use a snapshot other than the one from the > REPEATABLE READ transaction in which it was run? It's outside of analyze.c: autovacuum_do_vac_analyze() -> vacuum() -> if (options & VACOPT_VACUUM) use_own_xacts = true; else { Assert(options & VACOPT_ANALYZE); if (IsAutoVacuumWorkerProcess()) use_own_xacts = true; ... if (options & VACOPT_ANALYZE) { /* * If using separate xacts, start one for analyze. Otherwise, * we can use the outer transaction. */ if (use_own_xacts) { StartTransactionCommand(); /* functions in indexes may want a snapshot set */ PushActiveSnapshot(GetTransactionSnapshot()); } analyze_rel(relid, relation, options, params, va_cols, in_outer_xact, vac_strategy); if (use_own_xacts) { PopActiveSnapshot(); CommitTransactionCommand(); } } Andres -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers