pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Kevin Grittner <kgrittn@ymail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: brin index vacuum versus transaction snapshots
Date: Tue, 4 Aug 2015 15:28:12 -0300
Message-ID: <20150804182812.GT2441@postgresql.org> (raw)
In-Reply-To: <CA+Tgmoamt+yzcuuJRvb0gwHVnawT=iPDJdnS2+HEgDv68NZ3xw@mail.gmail.com>
References: <20150730200140.GV2441@postgresql.org>
	<784585654.3180934.1438353052254.JavaMail.yahoo@mail.yahoo.com>
	<20150731175700.GX2441@postgresql.org>
	<20150731194524.GB2441@postgresql.org>
	<CA+Tgmoamt+yzcuuJRvb0gwHVnawT=iPDJdnS2+HEgDv68NZ3xw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Robert Haas wrote:
> On Fri, Jul 31, 2015 at 3:45 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> 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



view thread (20+ messages)  latest in thread

Message-ID: <20150804182812.GT2441@postgresql.org>
Permalink:  ../20150804182812.GT2441@postgresql.org/
Also on:    postgresql.org/message-id/20150804182812.GT2441@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, robertmhaas@gmail.com, kgrittn@ymail.com
  Subject: Re: brin index vacuum versus transaction snapshots
  In-Reply-To: <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> <CA+Tgmoamt+yzcuuJRvb0gwHVnawT=iPDJdnS2+HEgDv68NZ3xw@mail.gmail.com> <20150804182812.GT2441@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox