pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bossart, Nathan <bossartn@amazon.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: John Naylor <john.naylor@enterprisedb.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: do only critical work during single-user vacuum?
Date: Wed, 19 Jan 2022 19:57:23 +0000
Message-ID: <4DA856C5-5409-48F9-8F34-9EA1FABA6923@amazon.com> (raw)
In-Reply-To: <CAD21AoCj-uRMkWFaZkDpKaDWcJ4BCuoYVWPRCuGDPcNNwYVy_Q@mail.gmail.com>
References: <CAFBsxsFL5LoWanSLDjt_SjS9=FU_9XWi22iHMexRS2SubkX-Vw@mail.gmail.com>
	<CAH2-Wz=Z5Jjd1y8kCfXd6e-GSvKiL8XEmxoJJFNHcekM4aw-Vg@mail.gmail.com>
	<CAH2-Wzn3pE8rNzBxh-Qpmq=zxFWFpoC7LWLbyDg_1XZ3wJOtUA@mail.gmail.com>
	<CAFBsxsG-VDhXYa25uERfDGD4dO_AZ3d+Dv2NF+DJBADZiXejpw@mail.gmail.com>
	<CAH2-Wznop1jM3j6E1xTcG--kFQ1hW5cMmM8B1965Mz+uUg6HSg@mail.gmail.com>
	<3F7FD826-36EF-4991-AB37-81675AFEBF54@amazon.com>
	<0544901A-0FC5-46B5-801B-F30AC0B81A19@amazon.com>
	<CAH2-Wz=9mfmSL5QDG9GmXt2Av8NBvNSo+CF7FPW3g80awHab7Q@mail.gmail.com>
	<DB4D9904-146A-4B21-8362-99F885C489E1@amazon.com>
	<CAH2-Wz=Eb-jrhFK6=_WNT6V1JAK-qFOTu_4-yOpAhkEES4VeNA@mail.gmail.com>
	<20211221034630.maoteglpjqpgh62g@alap3.anarazel.de>
	<CAD21AoCz8=-jBTUBcQSveOMCLkJ=yUw5TYtfVPWKTXiLuan_CQ@mail.gmail.com>
	<CAH2-Wzn+PJ99oJRnN32ojvRpgH4xjmTOJZbt+GTHpDWN655Adg@mail.gmail.com>
	<CAD21AoAXHZ0J-Xd0RfP_VpkUnGv0G_gCbwt3aCuy6weOKNaHNw@mail.gmail.com>
	<CAFBsxsHCBWTJx5j6zKogh5-_wuggcHJT7g+5_TQVMyKvgCT4Fw@mail.gmail.com>
	<CAFBsxsE1TWidnMs=RMx1eb2QxqmNqdDaLLN5E7SP_v5_g2ZRwA@mail.gmail.com>
	<CAH2-Wzmt29ZUwXW+9ACvxMoN9AjSMuH_Oabk1_mJt78f58WdvQ@mail.gmail.com>
	<CAFBsxsEoYaGVFq+7UeW2kZzO8pCAOTUB+j5RNw-Hm-w_Xo97Xg@mail.gmail.com>
	<CAH2-Wzkyj3+o9ffKoNV=KG7_0sp0dKyR6Y0j8Pt1hYVkv6hSzw@mail.gmail.com>
	<CAD21AoB-_Fz9n71oW+Bj9TpzBCKYqwvE_wV0HGmCKd1Cwkf_PQ@mail.gmail.com>
	<CAFBsxsG=wKyxi+i-Ti1ZnMp+aogrCCT9KJrYfhG5aZL6E1XK3A@mail.gmail.com>
	<8274EAFF-2E66-41D6-8F7E-A7E4A8E9A0A3@amazon.com>
	<CAFBsxsEuY5NEVLiSE7sNCii455QGTA1TFxrNykwaRcuQ7XCz9g@mail.gmail.com>
	<C5284C56-3C80-4517-8E99-B04C2F731072@amazon.com>
	<CAD21AoCj-uRMkWFaZkDpKaDWcJ4BCuoYVWPRCuGDPcNNwYVy_Q@mail.gmail.com>

On 1/18/22, 9:47 PM, "Masahiko Sawada" <sawada.mshk@gmail.com> wrote:
> IIUC what we want to do here are two things: (1) select only old
> tables and (2) set INDEX_CLEANUP = off, TRUNCATE = off, and FREEZE =
> on. VACUUM LIMIT statement does both things at the same time. Although
> I’m concerned a bit about its flexibility, it’s a reasonable solution.
>
> On the other hand, it’s probably also useful to do either one thing in
> some cases. For instance, having a selector for (1) would be useful,
> and having a new option like FAST_FREEZE for (2) would also be useful.
> Given there is already a way for (2) (it does not default though), I
> think it might also be a good start inventing something for (1). For
> instance, a selector for VACUUM statement I came up with is:
>
> VACUUM (verbose on) TABLES WITH (min_xid_age = 1600000000);
> or
> VACUUM (verbose on) TABLES WITH (min_age = failsafe_limit);
>
> We can expand it in the future to select tables by, for example, dead
> tuple ratio, size, etc.
>
> It's a random thought but maybe worth considering.

That's an interesting idea.  A separate selector clause could also
allow users to choose how they interacted (e.g., should the options be
OR'd or AND'd).

Nathan



view thread (97+ messages)  latest in thread

Message-ID: <4DA856C5-5409-48F9-8F34-9EA1FABA6923@amazon.com>
Permalink:  ../4DA856C5-5409-48F9-8F34-9EA1FABA6923@amazon.com/
Also on:    postgresql.org/message-id/4DA856C5-5409-48F9-8F34-9EA1FABA6923@amazon.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-hackers@postgresql.org
  Cc: bossartn@amazon.com, sawada.mshk@gmail.com, john.naylor@enterprisedb.com, pg@bowt.ie, andres@anarazel.de
  Subject: Re: do only critical work during single-user vacuum?
  In-Reply-To: <4DA856C5-5409-48F9-8F34-9EA1FABA6923@amazon.com>
  References: <CAFBsxsFL5LoWanSLDjt_SjS9=FU_9XWi22iHMexRS2SubkX-Vw@mail.gmail.com> <CAH2-Wzn+PJ99oJRnN32ojvRpgH4xjmTOJZbt+GTHpDWN655Adg@mail.gmail.com> <CAD21AoAXHZ0J-Xd0RfP_VpkUnGv0G_gCbwt3aCuy6weOKNaHNw@mail.gmail.com> <CAFBsxsHCBWTJx5j6zKogh5-_wuggcHJT7g+5_TQVMyKvgCT4Fw@mail.gmail.com> <CAFBsxsE1TWidnMs=RMx1eb2QxqmNqdDaLLN5E7SP_v5_g2ZRwA@mail.gmail.com> <CAH2-Wzmt29ZUwXW+9ACvxMoN9AjSMuH_Oabk1_mJt78f58WdvQ@mail.gmail.com> <CAFBsxsEoYaGVFq+7UeW2kZzO8pCAOTUB+j5RNw-Hm-w_Xo97Xg@mail.gmail.com> <CAH2-Wzkyj3+o9ffKoNV=KG7_0sp0dKyR6Y0j8Pt1hYVkv6hSzw@mail.gmail.com> <CAD21AoB-_Fz9n71oW+Bj9TpzBCKYqwvE_wV0HGmCKd1Cwkf_PQ@mail.gmail.com> <CAFBsxsG=wKyxi+i-Ti1ZnMp+aogrCCT9KJrYfhG5aZL6E1XK3A@mail.gmail.com> <8274EAFF-2E66-41D6-8F7E-A7E4A8E9A0A3@amazon.com> <CAFBsxsEuY5NEVLiSE7sNCii455QGTA1TFxrNykwaRcuQ7XCz9g@mail.gmail.com> <C5284C56-3C80-4517-8E99-B04C2F731072@amazon.com> <CAD21AoCj-uRMkWFaZkDpKaDWcJ4BCuoYVWPRCuGDPcNNwYVy_Q@mail.gmail.com> <4DA856C5-5409-48F9-8F34-9EA1FABA6923@amazon.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