pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Yura Sokolov <y.sokolov@postgrespro.ru>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [PoC] Improve dead tuple storage for lazy vacuum
Date: Fri, 30 Jul 2021 12:34:12 -0700
Message-ID: <20210730193412.6hh5cf6b32iickcv@alap3.anarazel.de> (raw)
In-Reply-To: <CA+Tgmoakg4A4m2O0f_oa6DUiDmFGS9kJWNrNjj-JY5LGqdAv-Q@mail.gmail.com>
References: <CAD21AoDwERrrmH4hZu4JZrUHUt4VDnmoAd=tsuWNk0FjagjGZA@mail.gmail.com>
	<20210719234915.5kw6k2k5jojvamc5@alap3.anarazel.de>
	<c5a74d6832924e02c418e28573607f0b@postgrespro.ru>
	<CAD21AoDy2rmw7dGaGoFqkzxsd+kFg2ttz-bV1D8i=epCXrfWWA@mail.gmail.com>
	<CAD21AoATJQM4PuQ46NvQAAuxUcATmb7udFyummFHPN-QhUcL5g@mail.gmail.com>
	<20210728185259.g5pswu26odfqddxq@alap3.anarazel.de>
	<CAD21AoDf2j=gpNpVATXe+b27Xf1pNNhMMgs+oK3esOTjbZjHrg@mail.gmail.com>
	<CA+TgmoZy2ygb4AFq33g51BDkQpKZF32XQ_=+2mEANv_cQUzteg@mail.gmail.com>
	<20210729191424.lzo27vtqf3umijdq@alap3.anarazel.de>
	<CA+Tgmoakg4A4m2O0f_oa6DUiDmFGS9kJWNrNjj-JY5LGqdAv-Q@mail.gmail.com>

Hi,

On 2021-07-30 15:13:49 -0400, Robert Haas wrote:
> On Thu, Jul 29, 2021 at 3:14 PM Andres Freund <andres@anarazel.de> wrote:
> > I think those advantages are far outstripped by the big disadvantage of
> > needing to either size the array accurately from the start, or to
> > reallocate the whole array.  Our current pre-allocation behaviour is
> > very wasteful for most vacuums but doesn't handle large work_mem at all,
> > causing unnecessary index scans.
> 
> I agree that the current pre-allocation behavior is bad, but I don't
> really see that as an issue with my idea. Fixing that would require
> allocating the array in chunks, but that doesn't really affect the
> core of the idea much, at least as I see it.

Well, then it'd not really be the "simple array approach" anymore :)


> But I accept that Yura has a very good point about the memory usage of
> what I was proposing.

The lower memory usage also often will result in a better cache
utilization - which is a crucial factor for index vacuuming when the
index order isn't correlated with the heap order. Cache misses really
are a crucial performance factor there.

Greetings,

Andres Freund





view thread (462+ messages)  latest in thread

Message-ID: <20210730193412.6hh5cf6b32iickcv@alap3.anarazel.de>
Permalink:  ../20210730193412.6hh5cf6b32iickcv@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20210730193412.6hh5cf6b32iickcv@alap3.anarazel.de

 · 

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: andres@anarazel.de, robertmhaas@gmail.com, sawada.mshk@gmail.com, y.sokolov@postgrespro.ru
  Subject: Re: [PoC] Improve dead tuple storage for lazy vacuum
  In-Reply-To: <20210730193412.6hh5cf6b32iickcv@alap3.anarazel.de>
  References: <CAD21AoDwERrrmH4hZu4JZrUHUt4VDnmoAd=tsuWNk0FjagjGZA@mail.gmail.com> <20210719234915.5kw6k2k5jojvamc5@alap3.anarazel.de> <c5a74d6832924e02c418e28573607f0b@postgrespro.ru> <CAD21AoDy2rmw7dGaGoFqkzxsd+kFg2ttz-bV1D8i=epCXrfWWA@mail.gmail.com> <CAD21AoATJQM4PuQ46NvQAAuxUcATmb7udFyummFHPN-QhUcL5g@mail.gmail.com> <20210728185259.g5pswu26odfqddxq@alap3.anarazel.de> <CAD21AoDf2j=gpNpVATXe+b27Xf1pNNhMMgs+oK3esOTjbZjHrg@mail.gmail.com> <CA+TgmoZy2ygb4AFq33g51BDkQpKZF32XQ_=+2mEANv_cQUzteg@mail.gmail.com> <20210729191424.lzo27vtqf3umijdq@alap3.anarazel.de> <CA+Tgmoakg4A4m2O0f_oa6DUiDmFGS9kJWNrNjj-JY5LGqdAv-Q@mail.gmail.com> <20210730193412.6hh5cf6b32iickcv@alap3.anarazel.de>

* 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