Re: Redundant Result node

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Redundant Result node
Date: 2024-08-23 02:31:14
Message-ID: CAMbWs49=CXNBjRWDcTv2gyu7iTHxMLsduMB_0iEudFdwfVsebA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 22, 2024 at 8:03 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> On Thu, 22 Aug 2024 at 23:33, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> > > I wonder if we need to invent a function to compare two PathTargets.
> >
> > Wouldn't the normal node equal() work?
>
> It might. I think has_volatile_expr might be missing a
> pg_node_attr(equal_ignore).

Yeah, maybe we can make the node equal() work for PathTarget. We'll
need to remove the no_equal attribute in PathTarget. I think we also
need to specify pg_node_attr(equal_ignore) for PathTarget.cost.

BTW, I'm wondering why we specify no_copy for PathTarget, while
meanwhile implementing a separate function copy_pathtarget() in
tlist.c to copy a PathTarget. Can't we support copyObject() for
PathTarget?

Also the pg_node_attr(array_size(exprs)) attribute for
PathTarget.sortgrouprefs does not seem right to me. In a lot of cases
sortgrouprefs would just be NULL. Usually it is valid only for
upper-level Paths. Hmm, maybe this is why we do not support
copyObject() for PathTarget?

Thanks
Richard

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2024-08-23 02:33:47 Re: slru bank
Previous Message Tom Lane 2024-08-23 02:27:42 Re: slru bank