Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZMgy9-0004yJ-If for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Aug 2015 18:29:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZMgy8-0002TF-DE for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Aug 2015 18:29:44 +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) (envelope-from ) id 1ZMgwq-00012d-LC for pgsql-hackers@postgresql.org; Tue, 04 Aug 2015 18:28:24 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZMgwm-0000cG-Ip for pgsql-hackers@postgresql.org; Tue, 04 Aug 2015 18:28:23 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.104.169.63]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 0CB3440111E; Tue, 4 Aug 2015 11:28:15 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 01CB7751; Tue, 4 Aug 2015 15:28:12 -0300 (CLT) Date: Tue, 4 Aug 2015 15:28:12 -0300 From: Alvaro Herrera To: Robert Haas Cc: Kevin Grittner , PostgreSQL-development Subject: Re: brin index vacuum versus transaction snapshots Message-ID: <20150804182812.GT2441@postgresql.org> References: <20150730200140.GV2441@postgresql.org> <784585654.3180934.1438353052254.JavaMail.yahoo@mail.yahoo.com> <20150731175700.GX2441@postgresql.org> <20150731194524.GB2441@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas wrote: > On Fri, Jul 31, 2015 at 3:45 PM, Alvaro Herrera > wrote: > > I think the only way to close this hole is to have summarize_range() > > sleep until all open snapshots are gone after inserting the placeholder > > tuple and before acquiring the snapshot, similarly to how CREATE INDEX > > CONCURRENTLY does it. > > That's gonna be really slow, though, right? Even if you rework things > so that vacuum inserts all the placeholder tuples first, then waits, > then does all the summarization, that could easily turn a vacuum that > would have finished in a second into one that instead takes multiple > hours. During that time an AV worker is pinned down, and all sorts of > badness can ensue. Yeah, it is bad and I was concerned about that too. Thankfully I found another way to solve it, which is to forgo usage of MVCC here and instead use SnapshotAny. There's already a mode in IndexBuildHeapRangeScan that uses SnapshotAny, but it needs some tweaks to do what we need. I'm going to propose a patch along those lines shortly. > Maybe I'm misunderstanding, but this whole thing seems like a pretty > serious problem for BRIN. :-( With this new approach it shouldn't be. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers