Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asXJw-0003TB-D9 for pgsql-committers@arkaria.postgresql.org; Tue, 19 Apr 2016 15:12:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1asXJv-0007tb-Rw for pgsql-committers@arkaria.postgresql.org; Tue, 19 Apr 2016 15:12:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asXJv-0007tE-8R; Tue, 19 Apr 2016 15:12:07 +0000 Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1asXJn-0004R8-N7; Tue, 19 Apr 2016 15:12:06 +0000 Received: by mail-oi0-x232.google.com with SMTP id x201so11717675oif.3; Tue, 19 Apr 2016 08:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=bG9WvD1HMOztZlAJE634h8oxVX5EvlJ6njUTRTFEkok=; b=Lk4ExTUhKHA9huWEDNWKyJeJdmxuDObF4o/HR81AEmafljFAODa2HGGdqnRdG7NW5M qX6cxC9x+5Zf1a7nzuRQisji/2mqzJNrMnJTAKXJy3w0SZjMPkl4v9CbkAbxUOTiZPrv s6lfwyVRTqrrVEbqFagSxSItjTHqG9M1FH6lXl99/qrLn8V5THTaWHz8vRulDkGPG/4c ldbyzn3qTRwQKvw+1DZib5K+dca1RtQhOKYVU4hZCkREeXjNPqkDyH1J1UCgd9OiHuQV 6L22jQxEt2I5MFVCm2jNL40LWeLwOT9Te3Upuwg+1pmEk31rIh9iO+OoGVGjJrpp85OZ dbkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=bG9WvD1HMOztZlAJE634h8oxVX5EvlJ6njUTRTFEkok=; b=hJsfkFB/xHmTB7vfqsTSyhtMzBNylElbWLCCP2xeh+AA6H2nfBmvo/iim4lFnOph0A nD2CWxWuqMl2PwepHwIs+JgqnUOab2If+LlnIiPv282KxEj3wsRV51JdehfWThCyUvMr Sk33/AtXH46L8cFYFAtIXDaz6rrguaZjPmmeZbI90oU7l6CBEyZsOwD+VthQ9gn7+1EZ a8PFkE9Z5o8EFOsepxiQzj3CN3i4oresgcAO4zwGEI/J/YavAnKW/ohYV5agNCUnEuFB ggMVHcuTV0kHQT43oiF1wKissLftC+1a6iISBOkhPGwwLlQ0n0z/XK+Vl4ZLg5Wh3R9+ 72lw== X-Gm-Message-State: AOPr4FV0N4EhEtZ5p+yHvGU0a79skLlIU4kSKmAEwgsmtY6gg8O0637JWC+0MWgUixgUYGeDnlzpn4JgPMExbA== MIME-Version: 1.0 X-Received: by 10.202.178.135 with SMTP id b129mr1362294oif.139.1461078718076; Tue, 19 Apr 2016 08:11:58 -0700 (PDT) Received: by 10.182.123.39 with HTTP; Tue, 19 Apr 2016 08:11:57 -0700 (PDT) In-Reply-To: References: <20160412192801.wffn2vjyszyw4qa4@alap3.anarazel.de> <20160413171955.i53me46fqqhdlztq@alap3.anarazel.de> <20160413192110.fogwesjti3kxycnu@alap3.anarazel.de> <20160413200148.bawmwjdmggbllhha@alap3.anarazel.de> <20160416204452.GA1910190@tornado.leadboat.com> <20160416205630.puxsglckxi3sn5ec@alap3.anarazel.de> Date: Tue, 19 Apr 2016 10:11:57 -0500 Message-ID: Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < From: Kevin Grittner To: Amit Kapila Cc: Andres Freund , Noah Misch , Robert Haas , Kevin Grittner , "pgsql-hackers@postgresql.org" , "pgsql-committers@postgresql.org" Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.7 (--) 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 Tue, Apr 19, 2016 at 9:57 AM, Amit Kapila wrote: > On Sun, Apr 17, 2016 at 2:26 AM, Andres Freund wrote: >> >> On 2016-04-16 16:44:52 -0400, Noah Misch wrote: >> > That is more controversial than the potential ~2% regression for >> > old_snapshot_threshold=-1. Alvaro[2] and Robert[3] are okay releasing >> > that way, and Andres[4] is not. >> >> FWIW, I could be kinda convinced that it's temporarily ok, if there'd be >> a clear proposal on the table how to solve the scalability issue around >> MaintainOldSnapshotTimeMapping(). > > It seems that for read-only workloads, MaintainOldSnapshotTimeMapping() > takes EXCLUSIVE LWLock which seems to be a probable reason for a performance > regression. Now, here the question is do we need to acquire that lock if > xmin is not changed since the last time value of > oldSnapshotControl->latest_xmin is updated or xmin is lesser than equal to > oldSnapshotControl->latest_xmin? > If we don't need it for above cases, I think it can address the performance > regression to a good degree for read-only workloads when the feature is > enabled. Thanks, Amit -- I think something along those lines is the right solution to the scaling issues when the feature is enabled. For now I'm focusing on the back-patching issues and the performance regression when the feature is disabled, but I'll shift focus to this once the "killer" issues are in hand. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers