pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Remove unnecessary code in dependency_is_compatible_expression()
3+ messages / 1 participants
[nested] [flat]

* pgsql: Remove unnecessary code in dependency_is_compatible_expression()
@ 2023-03-14 15:10 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2023-03-14 15:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/684ffac8c7d2647d919495727d469c73129202ea

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Remove unnecessary code in dependency_is_compatible_expression()
@ 2023-03-14 15:10 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2023-03-14 15:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3b459444301c4c40e8d978ef6025c7177c85c017

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Remove unnecessary code in dependency_is_compatible_expression()
@ 2023-03-14 15:10 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2023-03-14 15:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-03-14 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 15:10 pgsql: Remove unnecessary code in dependency_is_compatible_expression() Tom Lane <tgl@sss.pgh.pa.us>
2023-03-14 15:10 pgsql: Remove unnecessary code in dependency_is_compatible_expression() Tom Lane <tgl@sss.pgh.pa.us>
2023-03-14 15:10 pgsql: Remove unnecessary code in dependency_is_compatible_expression() Tom Lane <tgl@sss.pgh.pa.us>

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