Re: MERGE bug report - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: MERGE bug report
Date
Msg-id 202204120747.ztq5ae6zbzew@alvherre.pgsql
Whole thread Raw
In response to Re: MERGE bug report  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-hackers
On 2022-Apr-11, Richard Guo wrote:

> At first I was wondering whether we need to also include vars used in
> each action's targetlist, just as what we did for each action's qual.
> Then later I realized parse_merge.c already did that. But now it looks
> much better to process them two in preprocess_targetlist.

Yeah.  I pushed that.

However, now EXPLAIN VERBOSE doesn't show the columns from the source
relation in the Output line --- I think only those that are used as join
quals are shown, thanks to distribute_quals_to_rels.  I think it would
be better to fix this.  Maybe expanding the source target list earlier
is called for, after all.  I looked at transformUpdateStmt and siblings
for inspiration, but came out blank.

> A minor comment is that we can use list_concat_copy(list1, list2)
> instead of list_concat(list_copy(list1), list2) for better efficiency.

Thanks for that tip.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"La vida es para el que se aventura"



pgsql-hackers by date:

Previous
From: "bucoo@sohu.com"
Date:
Subject: fix cost subqueryscan wrong parallel cost
Next
From: sirisha chamarthi
Date:
Subject: Unable to connect to Postgres13 server from psql client built on master