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 10:38:40 -0400
Message-ID: <1766633.1599575920@sss.pgh.pa.us> (raw)
In-Reply-To: <CABUevEy89njjF9HSCiJyzfa7R=7D_X0q5HXM+WOvObeTKrv14w@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>

Magnus Hagander <magnus@hagander.net> writes:
> Oh sure, but there is clearly *something* going on, so we should try to
> figure that out. Because a transaction running multiple independent selects
> with the defaults settings will not actually block autovacuum.

I don't think the OP is claiming that autovacuum is blocked, only that
it's failing to remove recently-dead rows that he thinks could be removed.

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.

There are some approximations involved in figuring out which rows are
potentially still visible to someone.  So perhaps this is a situation
where an approximation is being used and tighter analysis would have
shown that indeed a row could be removed.  But we haven't seen any
evidence of that so far.  The basic fact that A's snapshot is limiting
removal of rows from a table it has not touched is not a bug.

			regards, tom lane





view thread (24+ messages)  latest in thread

Message-ID: <1766633.1599575920@sss.pgh.pa.us>
Permalink:  ../1766633.1599575920@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1766633.1599575920@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: <1766633.1599575920@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>

* 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