pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Support partition pruning at execution time
Date: Sun, 08 Apr 2018 04:34:22 +0100
Message-ID: <876052idlu.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CAKJS1f_77en0Rv=r_zJWnYe8cD04BQ5QrrsKe5uJVL2uSxFCuw@mail.gmail.com>
References: <CAKJS1f_c=DLtE6_1e3um_tS8=pHbRY6mw2YrOpSUU6Lqt2nKPw@mail.gmail.com>
	<20180408001509.lpxp42cszn45d6qc@alvherre.pgsql>
	<CAKJS1f9jyTWmTcyqpSaFs5XmHqvbS7QXtmvvJyC13nXJbSV_Sw@mail.gmail.com>
	<CAKJS1f9CUYJwbY46RD9mO4pWv_5RcC8ZQV7T_jdR2YWi=Y5XZQ@mail.gmail.com>
	<CAKJS1f_77en0Rv=r_zJWnYe8cD04BQ5QrrsKe5uJVL2uSxFCuw@mail.gmail.com>

>>>>> "David" == David Rowley <david.rowley@2ndquadrant.com> writes:

 >> Setting autovacuum_naptime to 10 seconds makes it occur in 10 second
 >> intervals...

 David> Ok, I thought it might have been some concurrent vacuum on the
 David> table but the only tables I see being vacuumed are system
 David> tables.

It's not vacuum that tends to be the problem, but analyze (on any
table). Lazy-vacuum's snapshots are mostly ignored for computing global
xmin horizons by other vacuums, but analyze's snapshots are not.

 David> I tried performing a manual vacuum of each of these and could
 David> not get it to trigger, but then I did:

 David> select * from pg_class;

 David> from another session and then the script starts spitting out
 David> some errors.

Obviously, because the select holds a snapshot and therefore also holds
back OldestXmin.

You can't ever assume that data you just inserted will become
all-visible just because you just vacuumed the table, unless you know
that there is NO concurrent activity that might have a snapshot (and no
other possible reason why OldestXmin might be older than your insert).

-- 
Andrew (irc:RhodiumToad)




view thread (39+ messages)  latest in thread

Message-ID: <876052idlu.fsf@news-spur.riddles.org.uk>
Permalink:  ../876052idlu.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/876052idlu.fsf@news-spur.riddles.org.uk

 · 

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-committers@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, david.rowley@2ndquadrant.com, alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Support partition pruning at execution time
  In-Reply-To: <876052idlu.fsf@news-spur.riddles.org.uk>
  References: <CAKJS1f_c=DLtE6_1e3um_tS8=pHbRY6mw2YrOpSUU6Lqt2nKPw@mail.gmail.com> <20180408001509.lpxp42cszn45d6qc@alvherre.pgsql> <CAKJS1f9jyTWmTcyqpSaFs5XmHqvbS7QXtmvvJyC13nXJbSV_Sw@mail.gmail.com> <CAKJS1f9CUYJwbY46RD9mO4pWv_5RcC8ZQV7T_jdR2YWi=Y5XZQ@mail.gmail.com> <CAKJS1f_77en0Rv=r_zJWnYe8cD04BQ5QrrsKe5uJVL2uSxFCuw@mail.gmail.com> <876052idlu.fsf@news-spur.riddles.org.uk>

* 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