pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Visibility map, partial vacuums
Date: Mon, 24 Nov 2008 09:31:22 +0200
Message-ID: <492A584A.4050704@enterprisedb.com> (raw)
In-Reply-To: <27709.1227475122@sss.pgh.pa.us>
References: <4905AE17.7090305@enterprisedb.com>
	<491D376B.9000608@enterprisedb.com>
	<491D7F52.6070908@enterprisedb.com>
	<4925664C.3090605@enterprisedb.com>
	<26361.1227467112@sss.pgh.pa.us>
	<1227471538.7370.14.camel@jdavis-laptop>
	<27709.1227475122@sss.pgh.pa.us>

Tom Lane wrote:
> Reflecting on it though, maybe Heikki described the behavior too
> pessimistically anyway.  If a page contains no dead tuples, it should
> get its bits set on first visit anyhow, no?  So for the ordinary bulk
> load scenario where there are no failed insertions, the first vacuum
> pass should set all the bits ... at least, if enough time has passed
> for RecentXmin to be past the inserting transaction.

Right. I did say "... after a delete or update, it takes two vacuums 
until ..." in my mail.

> However, my comment above was too optimistic, because in an insert-only
> scenario autovac would in fact not trigger VACUUM at all, only ANALYZE.
> 
> So it seems like we do indeed want to rejigger autovac's rules a bit
> to account for the possibility of wanting to apply vacuum to get
> visibility bits set.

I'm not too excited about triggering an extra vacuum. As Matthew pointed 
out, the point of this patch is to reduce the number of vacuums 
required, not increase it. If you're not going to vacuum a table, you 
don't care if the bits in the visibility map are set or not.

We could set the PD_ALL_VISIBLE flag more aggressively, outside VACUUMs, 
if we want to make the seqscan optimization more effective. For example, 
a seqscan could set the flag too, if it sees that all the tuples were 
visible, and had the XMIN_COMMITTED and XMAX_INVALID hint bits set.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (53+ messages)  latest in thread

Message-ID: <492A584A.4050704@enterprisedb.com>
Permalink:  ../492A584A.4050704@enterprisedb.com/
Also on:    postgresql.org/message-id/492A584A.4050704@enterprisedb.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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, tgl@sss.pgh.pa.us, pgsql@j-davis.com
  Subject: Re: Visibility map, partial vacuums
  In-Reply-To: <492A584A.4050704@enterprisedb.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