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

Re: Have vacuum emit a warning when it runs out of maintenance_work_mem

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-patches(at)postgresql(dot)org, Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>, Jim Nasby <decibel(at)decibel(dot)org>
Subject: Re: Have vacuum emit a warning when it runs out of maintenance_work_mem
Date: 2007-05-13 10:15:32
Message-ID: 4646E544.7020706@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-patches
Tom Lane wrote:
> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
>> Or we could switch to a more compact representation of the dead tuples, 
>> and not need such a big maintenance_work_mem in the first place.
> 
> Hm, you got any ideas?  One constraint is that it doesn't seem
> acceptable to make the search function any slower.

That's the biggest problem.

One idea is to use a compressed bitmap like in the bitmap index patch, 
and a tree of block numbers or ranges to allow random access to it.

Another idea is to use the current array representation, but instead of 
storing a item pointer on every slot, you store either a normal item 
pointer, or three extra offsets on the previous block. To make the 
binary search work, set the high bit (which isn't used otherwise) of the 
extra offsets to tell them apart from normal item pointers. When the 
binary search lands on those extra offsets, scan backwards to the 
closest normal item to get the block number.

Performance is a bit hard to predict. A more compact representation 
might be more cache-efficient, which might offset the cost of a more 
complex search function.

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

In response to

Responses

pgsql-patches by date

Next:From: Heikki LinnakangasDate: 2007-05-13 10:19:07
Subject: Re: Have vacuum emit a warning when it runs out of maintenance_work_mem
Previous:From: Heikki LinnakangasDate: 2007-05-13 06:54:20
Subject: Re: Performance monitoring

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