pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Further adjustments to PlaceHolderVar removal.
4+ messages / 1 participants
[nested] [flat]

* pgsql: Further adjustments to PlaceHolderVar removal.
@ 2015-08-07 18:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2015-08-07 18:14 UTC (permalink / raw)
  To: pgsql-committers

Further adjustments to PlaceHolderVar removal.

A new test case from Andreas Seltenreich showed that we were still a bit
confused about removing PlaceHolderVars during join removal.  Specifically,
remove_rel_from_query would remove a PHV that was used only underneath
the removable join, even if the place where it's used was the join partner
relation and not the join clause being deleted.  This would lead to a
"too late to create a new PlaceHolderInfo" error later on.  We can defend
against that by checking ph_eval_at to see if the PHV could possibly be
getting used at some partner rel.

Also improve some nearby LATERAL-related logic.  I decided that the check
on ph_lateral needed to take precedence over the check on ph_needed, in
case there's a lateral reference underneath the join being considered.
(That may be impossible, but I'm not convinced of it, and it's easy enough
to defend against the case.)  Also, I realized that remove_rel_from_query's
logic for updating LateralJoinInfos is dead code, because we don't build
those at all until after join removal.

Back-patch to 9.3.  Previous versions didn't have the LATERAL issues, of
course, and they also didn't attempt to remove PlaceHolderInfos during join
removal.  (I'm starting to wonder if changing that was really such a great
idea.)

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/89db83922a7f8ba223e233e262004b1745ece75d

Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c |   44 +++++++++++------------------
src/test/regress/expected/join.out        |   41 +++++++++++++++++++++++++++
src/test/regress/sql/join.sql             |   25 ++++++++++++++++
3 files changed, 83 insertions(+), 27 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Further adjustments to PlaceHolderVar removal.
@ 2015-08-07 18:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2015-08-07 18:14 UTC (permalink / raw)
  To: pgsql-committers

Further adjustments to PlaceHolderVar removal.

A new test case from Andreas Seltenreich showed that we were still a bit
confused about removing PlaceHolderVars during join removal.  Specifically,
remove_rel_from_query would remove a PHV that was used only underneath
the removable join, even if the place where it's used was the join partner
relation and not the join clause being deleted.  This would lead to a
"too late to create a new PlaceHolderInfo" error later on.  We can defend
against that by checking ph_eval_at to see if the PHV could possibly be
getting used at some partner rel.

Also improve some nearby LATERAL-related logic.  I decided that the check
on ph_lateral needed to take precedence over the check on ph_needed, in
case there's a lateral reference underneath the join being considered.
(That may be impossible, but I'm not convinced of it, and it's easy enough
to defend against the case.)  Also, I realized that remove_rel_from_query's
logic for updating LateralJoinInfos is dead code, because we don't build
those at all until after join removal.

Back-patch to 9.3.  Previous versions didn't have the LATERAL issues, of
course, and they also didn't attempt to remove PlaceHolderInfos during join
removal.  (I'm starting to wonder if changing that was really such a great
idea.)

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/868bfd1f3db3f79d5f86577e3171fdff40ce21fe

Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c |   44 +++++++++++------------------
src/test/regress/expected/join.out        |   41 +++++++++++++++++++++++++++
src/test/regress/sql/join.sql             |   25 ++++++++++++++++
3 files changed, 83 insertions(+), 27 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Further adjustments to PlaceHolderVar removal.
@ 2015-08-07 18:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2015-08-07 18:14 UTC (permalink / raw)
  To: pgsql-committers

Further adjustments to PlaceHolderVar removal.

A new test case from Andreas Seltenreich showed that we were still a bit
confused about removing PlaceHolderVars during join removal.  Specifically,
remove_rel_from_query would remove a PHV that was used only underneath
the removable join, even if the place where it's used was the join partner
relation and not the join clause being deleted.  This would lead to a
"too late to create a new PlaceHolderInfo" error later on.  We can defend
against that by checking ph_eval_at to see if the PHV could possibly be
getting used at some partner rel.

Also improve some nearby LATERAL-related logic.  I decided that the check
on ph_lateral needed to take precedence over the check on ph_needed, in
case there's a lateral reference underneath the join being considered.
(That may be impossible, but I'm not convinced of it, and it's easy enough
to defend against the case.)  Also, I realized that remove_rel_from_query's
logic for updating LateralJoinInfos is dead code, because we don't build
those at all until after join removal.

Back-patch to 9.3.  Previous versions didn't have the LATERAL issues, of
course, and they also didn't attempt to remove PlaceHolderInfos during join
removal.  (I'm starting to wonder if changing that was really such a great
idea.)

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/085338822a2364b5d3afbb13c635b00df43ade45

Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c |   44 +++++++++++------------------
src/test/regress/expected/join.out        |   41 +++++++++++++++++++++++++++
src/test/regress/sql/join.sql             |   25 ++++++++++++++++
3 files changed, 83 insertions(+), 27 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Further adjustments to PlaceHolderVar removal.
@ 2015-08-07 18:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2015-08-07 18:14 UTC (permalink / raw)
  To: pgsql-committers

Further adjustments to PlaceHolderVar removal.

A new test case from Andreas Seltenreich showed that we were still a bit
confused about removing PlaceHolderVars during join removal.  Specifically,
remove_rel_from_query would remove a PHV that was used only underneath
the removable join, even if the place where it's used was the join partner
relation and not the join clause being deleted.  This would lead to a
"too late to create a new PlaceHolderInfo" error later on.  We can defend
against that by checking ph_eval_at to see if the PHV could possibly be
getting used at some partner rel.

Also improve some nearby LATERAL-related logic.  I decided that the check
on ph_lateral needed to take precedence over the check on ph_needed, in
case there's a lateral reference underneath the join being considered.
(That may be impossible, but I'm not convinced of it, and it's easy enough
to defend against the case.)  Also, I realized that remove_rel_from_query's
logic for updating LateralJoinInfos is dead code, because we don't build
those at all until after join removal.

Back-patch to 9.3.  Previous versions didn't have the LATERAL issues, of
course, and they also didn't attempt to remove PlaceHolderInfos during join
removal.  (I'm starting to wonder if changing that was really such a great
idea.)

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/30b4ccdab70aad4178cf6876f25c5bba27035558

Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c |   44 +++++++++++------------------
src/test/regress/expected/join.out        |   41 +++++++++++++++++++++++++++
src/test/regress/sql/join.sql             |   25 ++++++++++++++++
3 files changed, 83 insertions(+), 27 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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


end of thread, other threads:[~2015-08-07 18:14 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-08-07 18:14 pgsql: Further adjustments to PlaceHolderVar removal. Tom Lane <tgl@sss.pgh.pa.us>
2015-08-07 18:14 pgsql: Further adjustments to PlaceHolderVar removal. Tom Lane <tgl@sss.pgh.pa.us>
2015-08-07 18:14 pgsql: Further adjustments to PlaceHolderVar removal. Tom Lane <tgl@sss.pgh.pa.us>
2015-08-07 18:14 pgsql: Further adjustments to PlaceHolderVar removal. 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