Re: clean up docs for v12

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: clean up docs for v12
Date: 2019-04-22 16:53:24
Message-ID: 20190422165324.iyduznrdspcia7ja@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-04-22 09:43:56 -0700, Andres Freund wrote:
> On 2019-04-22 12:33:24 -0400, Tom Lane wrote:
> > ISTM that Michael's proposed wording change shows that the existing
> > comment is easily misinterpreted. I don't think these minor grammatical
> > fixes will avoid the misinterpretation problem, and so some more-extensive
> > rewording is called for.
>
> Fair enough.

The computation of that variable above has:

* If the column is possibly missing, we can't rely on its (or
* subsequent) NOT NULL constraints to indicate minimum attributes in
* the tuple, so stop here.
*/
if (att->atthasmissing)
break;

/*
* Column is NOT NULL and there've been no preceding missing columns,
* it's guaranteed that all columns up to here exist at least in the
* NULL bitmap.
*/
if (att->attnotnull)
guaranteed_column_number = attnum;

and only then the comment referenced in the discussion here follows:
/*
* Check if's guaranteed the all the desired attributes are available in
* tuple. If so, we can start deforming. If not, need to make sure to
* fetch the missing columns.
*/

I think just reformulating that to something like

/*
* Check if it's guaranteed that all the desired attributes are available
* in the tuple (but still possibly NULL), by dint of either the last
* to-be-deformed column being NOT NULL, or subsequent ones not accessed
* here being NOT NULL. If that's not guaranteed the tuple headers natt's
* has to be checked, and missing attributes potentially have to be
* fetched (using slot_getmissingattrs().
*/

should make that clearer?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2019-04-22 16:54:51 Optimizer items in the release notes
Previous Message Andres Freund 2019-04-22 16:43:56 Re: clean up docs for v12