Re: a vacuum thread is not the answer

From: Hannu Krosing <hannu(at)krosing(dot)net>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: a vacuum thread is not the answer
Date: 2002-03-07 20:49:41
Message-ID: 1015534182.2111.7.camel@rh72.home.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2002-03-07 at 20:15, mlw wrote:
> I was just toying around with things, and you know, running vacuum in the
> background doesn't work. It slows things down too much.
>
> The worst case senario is when one does this:
>
> update accounts set abalance = abalance + 1 ;
>
> This takes forever to run and doubles the size of the table.

How is this related to running vacuum in background ?

Does it run fast when vacuum is not running ?

> Is there a way that a separate thread managing the freelist can perform a "per
> row" vacuum concurrently? Maybe I am stating the problem incorrectly, but we
> need to be able to recover rows already in memory for performance.

What could be possibly done (and is probably not very useful anyway) is
reusing the row modified _in_the_same_transaction_ so that

begin;
abalance = abalance + 1 ;
abalance = abalance + 1 ;
abalance = abalance + 1 ;
end;

would consume just 2x the tablespace and not 4x. But this does not
require a separate thread, just some changes in update logic.

OTOH, this will probably interfere with some transaction modes that make
use of command ids.

--------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Buttafuoco 2002-03-07 21:05:19 Re: Storage Location / Tablespaces (try 3)
Previous Message Bruce Momjian 2002-03-07 20:48:19 Re: date formatting and tab-complete patch