Re: Redundant Result node - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Redundant Result node
Date
Msg-id CAEudQAqrO-qyMuOHJcPp4L4wLJtOuOSEduHVkfLexMTc+AC05g@mail.gmail.com
Whole thread Raw
In response to Re: Redundant Result node  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-hackers
Em ter., 27 de ago. de 2024 às 00:43, Richard Guo <guofenglinux@gmail.com> escreveu:
On Thu, Aug 22, 2024 at 9:02 PM Ranier Vilela <ranier.vf@gmail.com> wrote:
> Em qui., 22 de ago. de 2024 às 04:34, Richard Guo <guofenglinux@gmail.com> escreveu:
>> This does not seem right to me, as PathTargets are not canonical, so
>> we cannot guarantee that two identical PathTargets will have the same
>> pointer.  Actually, for the query above, the two PathTargets are
>> identical but have different pointers.
>
> Could memcmp solve this?

Hmm, I don't think memcmp works for nodes that contain pointers.
The first case which memcmp can fail is if both pointers are null.
But considering the current behavior, the cost vs benefit favors memcmp.

best regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Parallel CREATE INDEX for GIN indexes
Next
From: Jim Jones
Date:
Subject: Re: [PATCH] Add CANONICAL option to xmlserialize