Skip site navigation (1) Skip section navigation (2)

Re: Order of operations in lazy_vacuum_rel

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Order of operations in lazy_vacuum_rel
Date: 2010-02-09 01:54:18
Message-ID: 4790.1265680458@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Tom Lane wrote:
>> Maybe we should do
>> something about this.  There wasn't any obvious solution before,
>> but now that we have the nontransactional smgr-level sinval messages
>> being sent on drops and truncates, it seems like tying rd_targblock
>> clearing to those would fix the problem.

> Hmm, sounds good, though I confess not having heard about
> nontransactional sinval messages before.

Hey, they've been in there almost a week ;-)
http://archives.postgresql.org/pgsql-committers/2010-02/msg00026.php

>> The easiest way to do that
>> would involve moving rd_targblock down to the SMgrRelation struct.
>> Probably rd_fsm_nblocks and rd_vm_nblocks too.  Comments?

> Can't say it doesn't look like a modularity violation from here --
> insertion target block doesn't really belong into smgr, does it?

It never belonged in relcache, either.  Trying to keep dynamic state
(not backed by a catalog entry) in the relcache has always been a
pretty klugy thing.  smgr at least has a reasonable excuse for trying
to keep track of physical truncation events, which is the thing we need
here.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Fujii MasaoDate: 2010-02-09 01:57:44
Subject: Re: Streaming replication in docs
Previous:From: Andrew McNamaraDate: 2010-02-09 01:51:09
Subject: Re: Confusion over Python drivers

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group