Re: Redundant check of em_is_child

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Redundant check of em_is_child
Date: 2017-06-22 15:00:58
Message-ID: CA+Tgmob9Bt+WVyhbicnF7g4--nf2GbnzRf7sQ=S8XX6-SK4jAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 19, 2017 at 3:46 AM, Amit Langote
<Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> In match_eclasses_to_foreign_key_col(), there is this:
>
> if (em->em_is_child)
> continue; /* ignore children here */
>
> ISTM, it might as well be:
>
> Assert(!em->em_is_child); /* no children yet */
>
> That's because, I think it's still too early in query_planner() to be
> expecting any child EC members.

I'm not sure there's really any benefit to this change. In the
future, somebody might want to use the function from someplace later
on in the planner. If the logic as-written would work correctly in
that case now, I can't see why we should turn it into an assertion
failure instead. This isn't really costing us anything, is it?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-06-22 15:02:16 Re: Multiple TO version in ALTER EXTENSION UPDATE
Previous Message Robert Haas 2017-06-22 14:54:52 Re: Prologue of set_append_rel_size() and partitioned tables