Re: Setting visibility map in VACUUM's second phase

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting visibility map in VACUUM's second phase
Date: 2013-01-27 07:25:04
Message-ID: CABOikdMd0-tvpmOHSxXEOjn1gZ2LboYavg_8EOfUkbO96DssAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 24, 2013 at 9:31 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> On Thu, Jan 24, 2013 at 1:28 AM, Pavan Deolasee
> <pavan(dot)deolasee(at)gmail(dot)com> wrote:

>>
>> Good idea. Even though the cost of pinning/unpinning may not be high
>> with respect to the vacuum cost itself, but it seems to be a good idea
>> because we already do that at other places. Do you have any other
>> review comments on the patch or I'll fix this and send an updated
>> patch soon.
>
> That was the only thing that stood out to me.

The attached patch gets that improvement. Also rebased on the latest head.

> You had some doubts
> about visibility_cutoff_xid, but I don't know enough about that to
> address them. I agree that it would be nice to avoid the code
> duplication, but I don't see a reasonable way to do that.
>

I have left a comment there to ensure that someone changing the code
also takes pain to look at the other part.

> It applies cleanly (some offsets), builds without warnings, passes
> make check under cassert. No documentation or regression tests are
> needed. We want this, and it does it.
>
> I have verified the primary objective (setting vm sooner) but haven't
> experimentally verified that this actually increases throughput for
> some workload. For pgbench when all data fits in shared_buffers, at
> least it doesn't cause a readily noticeable slow down.
>
> I haven't devised any patch-specific test cases, either for
> correctness or performance. I just used make check, pgbench, and the
> "vacuum verbose" verification you told us about in the original
> submission.

Thanks for the tests and all the review.

>
> If we are going to scan a block twice, I wonder if it should be done
> the other way around. If there are any dead tuples that need to be
> removed from indexes, there is no point in dirtying the page with a
> HOT prune on the first pass when it will just be dirtied again after
> the indexes are vacuumed. I don't see this idea holding up your patch
> though, as surely it would be more invasive than what you are doing.
>

I think there is a merit in this idea. But as you rightly said, we
should tackle that as a separate patch.

Thanks,
Pavan

--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee

Attachment Content-Type Size
vacuum-secondphase-setvm-v3.patch application/octet-stream 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-01-27 07:32:07 Re: enhanced error fields
Previous Message Kohei KaiGai 2013-01-27 06:55:00 Re: [v9.3] OAT_POST_ALTER object access hooks