pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Magnus Hagander <magnus@hagander.net>
Cc: Michael Holzman <michaelholzman@gmail.com>
Cc: pgsql-general General <pgsql-general@postgresql.org>
Subject: Re: Autovacuum of independent tables
Date: Tue, 08 Sep 2020 11:15:58 -0400
Message-ID: <1768409.1599578158@sss.pgh.pa.us> (raw)
In-Reply-To: <CABUevEzxqMwjMPV3doaFZog76vX6p3nK+awhhJ8KNPJqUc4TSw@mail.gmail.com>
References: <CAPNViJrQFge6EW_dvwaLB8pjRq4K51vnvcYBPNb8SuTW88MrBw@mail.gmail.com>
	<CAFj8pRD1=CUAhixyP5CGGsc=GOHFWX3oM22WFU6KnH1CAqN2YQ@mail.gmail.com>
	<CAPNViJrFNA8xiEgFeDoZ1GVKndx-MQXsES0Lg2hzrkNohzfJSA@mail.gmail.com>
	<20200908082755.GI19261@paquier.xyz>
	<CAPNViJo0eRP10-e0VRVgzh2xPobay5FpY2z5OOSLS_-jtasVRg@mail.gmail.com>
	<CAFj8pRCH_P5YJZaLad1kTw-boGd=PGhY73BR=awLqpGtw3=0zg@mail.gmail.com>
	<CAPNViJoV+Bpgja8vEES2dnes-aHSbm_vxQZcmWOi+ZbrK2JhqA@mail.gmail.com>
	<CABUevEzUmSG2t4iebXkpToo8VtphAZ=_mBmW_2HW2OPfzG0Fww@mail.gmail.com>
	<CAPNViJoYRJne5rm1fomZWOQB7QMfZ15VvGgaPPSzCG1L8xSjbQ@mail.gmail.com>
	<CABUevExt_G98fka__-iba7rC3otQwGoO_vKHxJD1rVxNnS9sRg@mail.gmail.com>
	<CAPNViJqQccD8aRBdVntX-pSfC27bCHEAp3UvG9+W22aBZOUyWw@mail.gmail.com>
	<CABUevEy89njjF9HSCiJyzfa7R=7D_X0q5HXM+WOvObeTKrv14w@mail.gmail.com>
	<1766633.1599575920@sss.pgh.pa.us>
	<CABUevEzxqMwjMPV3doaFZog76vX6p3nK+awhhJ8KNPJqUc4TSw@mail.gmail.com>

Magnus Hagander <magnus@hagander.net> writes:
> On Tue, Sep 8, 2020 at 4:38 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The reason that's not so is that whether or not transaction A *has*
>> touched table B is irrelevant.  It *could* read table B at any moment,
>> for all autovacuum knows.  Therefore we cannot remove rows that should
>> still be visible to A's snapshot.

> Right. But in the default isolation level, the snapshot of A gets reset
> between each SELECT, and does not persist to the end of the transaction.

Well, we don't know what isolation level the OP is using.  We also don't
know what PG version he's using.  From memory, it hasn't been that long
since we fixed things so that an idle read-committed transaction
advertises no xmin.  It's also possible that the transaction isn't really
idle between statements (eg, if it's holding open cursors, or the like).

			regards, tom lane





view thread (24+ messages)  latest in thread

Message-ID: <1768409.1599578158@sss.pgh.pa.us>
Permalink:  ../1768409.1599578158@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1768409.1599578158@sss.pgh.pa.us

 · 

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, magnus@hagander.net, michaelholzman@gmail.com
  Subject: Re: Autovacuum of independent tables
  In-Reply-To: <1768409.1599578158@sss.pgh.pa.us>
  References: <CAPNViJrQFge6EW_dvwaLB8pjRq4K51vnvcYBPNb8SuTW88MrBw@mail.gmail.com> <CAFj8pRD1=CUAhixyP5CGGsc=GOHFWX3oM22WFU6KnH1CAqN2YQ@mail.gmail.com> <CAPNViJrFNA8xiEgFeDoZ1GVKndx-MQXsES0Lg2hzrkNohzfJSA@mail.gmail.com> <20200908082755.GI19261@paquier.xyz> <CAPNViJo0eRP10-e0VRVgzh2xPobay5FpY2z5OOSLS_-jtasVRg@mail.gmail.com> <CAFj8pRCH_P5YJZaLad1kTw-boGd=PGhY73BR=awLqpGtw3=0zg@mail.gmail.com> <CAPNViJoV+Bpgja8vEES2dnes-aHSbm_vxQZcmWOi+ZbrK2JhqA@mail.gmail.com> <CABUevEzUmSG2t4iebXkpToo8VtphAZ=_mBmW_2HW2OPfzG0Fww@mail.gmail.com> <CAPNViJoYRJne5rm1fomZWOQB7QMfZ15VvGgaPPSzCG1L8xSjbQ@mail.gmail.com> <CABUevExt_G98fka__-iba7rC3otQwGoO_vKHxJD1rVxNnS9sRg@mail.gmail.com> <CAPNViJqQccD8aRBdVntX-pSfC27bCHEAp3UvG9+W22aBZOUyWw@mail.gmail.com> <CABUevEy89njjF9HSCiJyzfa7R=7D_X0q5HXM+WOvObeTKrv14w@mail.gmail.com> <1766633.1599575920@sss.pgh.pa.us> <CABUevEzxqMwjMPV3doaFZog76vX6p3nK+awhhJ8KNPJqUc4TSw@mail.gmail.com> <1768409.1599578158@sss.pgh.pa.us>

* 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