Re: Problems with "pg.dropped" column after upgrade 9.5 to 9.6

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Pavel Hanák <hanak(at)is-it(dot)eu>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Problems with "pg.dropped" column after upgrade 9.5 to 9.6
Date: 2016-11-02 17:08:57
Message-ID: 27650.1478106537@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> So I'm pretty tempted to fix it as per attached, that is, teach setrefs.c
> that it's silly to try to convert a Const into a Var. It is sane to
> replace more-complicated expressions with Vars, because that means we save
> re-evaluating those expressions. But a quick look at ExecEvalConst and
> ExecEvalVar shows that a Const is strictly cheaper to execute than a Var,
> so doing such a conversion is actually a pessimization.

After further poking around, I concluded that it'd be a good idea to make
a similar change in set_dummy_tlist_references(), to prevent a failure
if the top plan node below ModifyTable chances to be a Sort or other
non-projecting plan node. I'm not sure such a case can arise today, but
I'm not sure it can't either.

With that, there are a couple more changes in regression test EXPLAIN
output. A full patch that passes "make check-world" is attached.

I'm not sure if it's worth memorializing the specific test case discussed
in this thread as a regression test. It depends enough on the behavior
of SQL function planning that I wouldn't have much confidence in it
continuing to test what we meant it to test going forward.

regards, tom lane

Attachment Content-Type Size
dont-make-Consts-into-Vars-2.patch text/x-diff 5.5 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Clinton Adams 2016-11-02 18:37:16 Re: BUG #14404: High row estimates when query uses master inherited tables
Previous Message Tom Lane 2016-11-02 15:52:16 Re: Problems with "pg.dropped" column after upgrade 9.5 to 9.6