agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Heikki Linnakangas <[email protected]>
To: Tom Lane <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: Visibility map, partial vacuums
Date: Wed, 26 Nov 2008 15:32:32 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

Tom Lane wrote:
> Heikki Linnakangas <[email protected]> writes:
>> There is another problem, though, if the map is frequently probed for 
>> pages that don't exist in the map, or the map doesn't exist at all. 
>> Currently, the size of the map file is kept in relcache, in the 
>> rd_vm_nblocks_cache variable. Whenever a page is accessed that's > 
>> rd_vm_nblocks_cache, smgrnblocks is called to see if the page exists, 
>> and rd_vm_nblocks_cache is updated. That means that every probe to a 
>> non-existing page causes an lseek(), which isn't free.
> 
> Well, considering how seldom new pages will be added to the visibility
> map, it seems to me we could afford to send out a relcache inval event
> when that happens.  Then rd_vm_nblocks_cache could be treated as
> trustworthy.
> 
> Maybe it'd be worth doing that for the FSM too.  The frequency of
> invals would be higher, but then again the reference frequency is
> probably higher too?

A relcache invalidation sounds awfully heavy-weight. Perhaps a 
light-weight invalidation event that doesn't flush the entry altogether, 
but just resets the cached sizes?

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



view thread (54+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Visibility map, partial vacuums
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox