Re: VACUUM optimization ideas.

From: hstenger(at)adinet(dot)com(dot)uy
To: Alfred Perlstein <bright(at)wintelcom(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: VACUUM optimization ideas.
Date: 2000-08-18 05:18:49
Message-ID: 399CC739.B9B13D18@adinet.com.uy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alfred Perlstein wrote:
> #1
>
> Reducing the time vacuum must hold an exlusive lock on a table:
>
> The idea is that since rows are marked deleted it's ok for the
> vacuum to fill them with data from the tail of the table as
> long as no transaction is in progress that has started before
> the row was deleted.
>
> This may allow the vacuum process to copyback all the data without
> a lock, when all the copying is done it then aquires an exlusive lock
> and does this:
>
> Aquire an exclusive lock.
> Walk all the deleted data marking it as current.
> Truncate the table.
> Release the lock.
>
> Since the data is still marked invalid (right?) even if valid data
> is copied into the space it should be ignored as long as there's no
> transaction occurring that started before the data was invalidated.

Yes, but nothing prevents newer transactions from modifying the _origin_ side of
the copied data _after_ it was copied, but before the Lock-Walk-Truncate-Unlock
cycle takes place, and so it seems unsafe. Maybe locking each record before
copying it up ...

Regards,
Haroldo.

--
----------------------+------------------------
Haroldo Stenger | hstenger(at)ieee(dot)org
Montevideo, Uruguay. | hstenger(at)adinet(dot)com(dot)uy
----------------------+------------------------
Visit UYLUG Web Site: http://www.linux.org.uy
-----------------------------------------------

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brian Hirt 2000-08-18 06:03:48 pg_attribute growing and growing and growing
Previous Message Philip Warner 2000-08-18 00:58:35 Re: Inserting a select statement result into another table