pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Autovacuum of independent tables
Date: Tue, 8 Sep 2020 09:47:08 -0500
Message-ID: <0085ec6b-353b-dff6-a91c-d5a05ad712c5@gmail.com> (raw)
In-Reply-To: <20200908082755.GI19261@paquier.xyz>
References: <CAPNViJrQFge6EW_dvwaLB8pjRq4K51vnvcYBPNb8SuTW88MrBw@mail.gmail.com>
	<CAFj8pRD1=CUAhixyP5CGGsc=GOHFWX3oM22WFU6KnH1CAqN2YQ@mail.gmail.com>
	<CAPNViJrFNA8xiEgFeDoZ1GVKndx-MQXsES0Lg2hzrkNohzfJSA@mail.gmail.com>
	<20200908082755.GI19261@paquier.xyz>



On 9/8/20 3:27 AM, Michael Paquier wrote:
> On Tue, Sep 08, 2020 at 11:16:04AM +0300, Michael Holzman wrote:
>> Autovacuum does not clean dead tuples of closed transactions in tableB
>> while there is an open transaction on tableA.
>> But the tables have nothing in common. They are handled by separate
>> applications and there are no transactions that touch both tables
>> simultaneously.
>> Why does autovacuum create an artificial dependency on the tables?
> This is called MVCC, which applies to a session as a whole.  The point
> here is that even if your application knows that only tableA is used
> by a given transaction, Postgres cannot know that, as it could be
> possible that data from tableB is needed in this same transaction, so
> old versions of the rows from tableB matching with the snapshot hold
> by this long-running transaction still have to be around.

Too bad the START TRANSACTION statement doesn't have a RESERVING clause 
where you can enumerate the tables you'll be using.

-- 
Angular momentum makes the world go 'round.





view thread (24+ messages)  latest in thread

Message-ID: <0085ec6b-353b-dff6-a91c-d5a05ad712c5@gmail.com>
Permalink:  ../0085ec6b-353b-dff6-a91c-d5a05ad712c5@gmail.com/
Also on:    postgresql.org/message-id/0085ec6b-353b-dff6-a91c-d5a05ad712c5@gmail.com

 · 

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: ronljohnsonjr@gmail.com
  Subject: Re: Autovacuum of independent tables
  In-Reply-To: <0085ec6b-353b-dff6-a91c-d5a05ad712c5@gmail.com>
  References: <CAPNViJrQFge6EW_dvwaLB8pjRq4K51vnvcYBPNb8SuTW88MrBw@mail.gmail.com> <CAFj8pRD1=CUAhixyP5CGGsc=GOHFWX3oM22WFU6KnH1CAqN2YQ@mail.gmail.com> <CAPNViJrFNA8xiEgFeDoZ1GVKndx-MQXsES0Lg2hzrkNohzfJSA@mail.gmail.com> <20200908082755.GI19261@paquier.xyz> <0085ec6b-353b-dff6-a91c-d5a05ad712c5@gmail.com>

* 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