Re: What is the point of setrefs.c's is_converted_whole_row_reference?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: What is the point of setrefs.c's is_converted_whole_row_reference?
Date: 2017-10-20 14:19:05
Message-ID: CA+TgmoasbzkRc94cxg17PyPm83+gT3TajnvMFTUgwbTTNFwCDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 19, 2017 at 2:56 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> AFAICS, setrefs.c's special treatment of "converted whole row references"
> is completely pointless. Why aren't they just treated by the regular
> "non var" code paths, thus saving code space and cycles?

Here's what one of Ashutosh's commit messages for one of the patches
in the stack said:

===
set_join_references() turns off outer side's has_non_vars to handle
expressions involving nullable side. Hence we can not use has_non_vars
to handle ConvertRowtypeExprs. Instead the patch adds
has_conv_whole_rows, which is set when there exist one or more of
ConvertRowtypeExprs described above.
===

I think that's referring to this comment:

* Now we need to fix up the targetlist and qpqual, which are logically
* above the join. This means they should not re-use any
input expression
* that was computed in the nullable side of an outer join. Vars and
* PlaceHolderVars are fine, so we can implement this
restriction just by
* clearing has_non_vars in the indexed_tlist structs.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-10-20 14:27:14 Re: [POC] Faster processing at Gather node
Previous Message Julien Rouhaud 2017-10-20 14:07:25 Re: 64-bit queryId?