Re: Documentation fixes for pg_visibility

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Documentation fixes for pg_visibility
Date: 2016-07-06 02:43:11
Message-ID: CAB7nPqRdMbJ2f+H+Ed=mb4ev5BiGFg6DnWQ1F8hdwbMOit+5EA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert wrote:
> I think there should probably be a test for
> all_visible_according_to_vm at the beginning of that so that we don't
> add more visibility map checks for pages where we already know the VM
> bit can't possibly be set.

Yes, that looks like a good idea after more screening of this code.

On Wed, Jul 6, 2016 at 12:21 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> So I'm a bit confused about what you are saying here. If the page is
> marked all-frozen but actually isn't all-frozen, then we should clear
> the all-frozen bit in the VM. The easiest way to do that is to clear
> both bits in the VM plus the page-level bit, as done here, because we
> don't presently have a way of clearing just one of the visibility map
> bits.

Yes, that's my understanding as well for what is necessary: clear both
bits in the vm as well as the bit on the page itself, and mark it as
dirty. Way to go.

> Now, since the heap_lock_tuple issue requires us to introduce a new
> method to clear all-visible without clearing all-frozen, we could
> possibly use that here too, once we have it.

For 10.0, working on lower-level routine optimizations of this kind
sounds good to me. But I vote against this level of code reordering in
9.6 post-beta2 if that's what you suggest.
--
Michael

Attachment Content-Type Size
vm-all-frozen-check-v2.patch text/x-diff 1.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-07-06 03:04:47 Re: Forthcoming SQL standards about JSON and Multi-Dimensional Arrays (FYI)
Previous Message Michael Paquier 2016-07-06 02:28:19 Header and comments describing routines in incorrect shape in visibilitymap.c