Re: lazy vacuum sleeps with exclusive lock on table - Mailing list pgsql-hackers

From ITAGAKI Takahiro
Subject Re: lazy vacuum sleeps with exclusive lock on table
Date
Msg-id 20070629091438.7C11.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Whole thread Raw
In response to Re: lazy vacuum sleeps with exclusive lock on table  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: lazy vacuum sleeps with exclusive lock on table
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> wrote:

> What I'm requesting here is that the sleep in count_nondeletable_pages()
> be removed and that change backpatched to 8.2 and 8.1.

Agreed. We'd better to shorten the exclusive locking as far as possible.

> We don't know how many pages we can truncate until after we have
> acquired the exclusive lock and examined the pages in question, scanning
> backwards from the end of the table.

But many OSes do not care about read-ahead in backward scanning. I have
a test result that shows truncating a large part of table takes very long
time. Is it better better to change it to forward scanning? For example,
starting with (tail of the file - 16MB) and scanning 16MB of segment forward
to decide the position for truncation. If we can truncate all of the segment,
do recheck from (tail of the file - 32MB) and repeat.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: write past chunk end in ExprContext / to_char
Next
From: Tom Lane
Date:
Subject: Re: lazy vacuum sleeps with exclusive lock on table