pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove unnecessary code in dependency_is_compatible_expression()
Date: Tue, 14 Mar 2023 15:10:52 +0000
Message-ID: <E1pc6Id-003WE6-OO@gemulon.postgresql.org> (raw)

Remove unnecessary code in dependency_is_compatible_expression().

Scanning the expression for compatible Vars isn't really necessary,
because the subsequent match against StatisticExtInfo entries will
eliminate expressions containing other Vars just fine.  Moreover,
this code hadn't stopped to think about what to do with
PlaceHolderVars or Aggrefs in the clause; and at least for the PHV
case, that demonstrably leads to failures.  Rather than work out
whether it's reasonable to ignore those, let's just remove the
whole stanza.

Per report from Richard Guo.  Back-patch to v14 where this code
was added.

Discussion: https://postgr.es/m/CAMbWs48Mmvm-acGevXuwpB=g5JMqVSL6i9z5UaJyLGJqa-XPAA@mail.gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7c509f7e5a817ea676479d33bb975d72785ff106

Modified Files
--------------
src/backend/statistics/dependencies.c | 28 +++-------------------------
1 file changed, 3 insertions(+), 25 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1pc6Id-003WE6-OO@gemulon.postgresql.org>
Permalink:  ../E1pc6Id-003WE6-OO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pc6Id-003WE6-OO@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Remove unnecessary code in dependency_is_compatible_expression()
  In-Reply-To: <E1pc6Id-003WE6-OO@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox