pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Remove bogus Assert and dead code in remove_useless_results_recu 5+ messages / 1 participants [nested] [flat]
* pgsql: Remove bogus Assert and dead code in remove_useless_results_recu @ 2022-11-29 15:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-11-29 15:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove bogus Assert and dead code in remove_useless_results_recurse(). The JOIN_SEMI case Assert'ed that there are no PlaceHolderVars that need to be evaluated at the semijoin's RHS, which is wrong because there could be some in the semijoin's qual condition. However, there could not be any references further up than that, and within the qual there is not any way that such a PHV could have gone to null yet, so we don't really need the PHV and there is no need to avoid making the RHS-removal optimization. The upshot is that there's no actual bug in production code, and we ought to just remove this misguided Assert. While we're here, also drop the JOIN_RIGHT case, which is dead code because reduce_outer_joins() already got rid of JOIN_RIGHT. Per bug #17700 from Xin Wen. Uselessness of the JOIN_RIGHT case pointed out by Richard Guo. Back-patch to v12 where this code was added. Discussion: https://postgr.es/m/17700-2b5c10d917c30687@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/51dfaa0b010c1efba8a4137cfccd5fbb7f5d4afd Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 24 +++++++++--------------- src/test/regress/expected/join.out | 20 ++++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Remove bogus Assert and dead code in remove_useless_results_recu @ 2022-11-29 15:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-11-29 15:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove bogus Assert and dead code in remove_useless_results_recurse(). The JOIN_SEMI case Assert'ed that there are no PlaceHolderVars that need to be evaluated at the semijoin's RHS, which is wrong because there could be some in the semijoin's qual condition. However, there could not be any references further up than that, and within the qual there is not any way that such a PHV could have gone to null yet, so we don't really need the PHV and there is no need to avoid making the RHS-removal optimization. The upshot is that there's no actual bug in production code, and we ought to just remove this misguided Assert. While we're here, also drop the JOIN_RIGHT case, which is dead code because reduce_outer_joins() already got rid of JOIN_RIGHT. Per bug #17700 from Xin Wen. Uselessness of the JOIN_RIGHT case pointed out by Richard Guo. Back-patch to v12 where this code was added. Discussion: https://postgr.es/m/17700-2b5c10d917c30687@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/aca695fb6847638538833821ebab8a62d51c4549 Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 24 +++++++++--------------- src/test/regress/expected/join.out | 20 ++++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Remove bogus Assert and dead code in remove_useless_results_recu @ 2022-11-29 15:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-11-29 15:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove bogus Assert and dead code in remove_useless_results_recurse(). The JOIN_SEMI case Assert'ed that there are no PlaceHolderVars that need to be evaluated at the semijoin's RHS, which is wrong because there could be some in the semijoin's qual condition. However, there could not be any references further up than that, and within the qual there is not any way that such a PHV could have gone to null yet, so we don't really need the PHV and there is no need to avoid making the RHS-removal optimization. The upshot is that there's no actual bug in production code, and we ought to just remove this misguided Assert. While we're here, also drop the JOIN_RIGHT case, which is dead code because reduce_outer_joins() already got rid of JOIN_RIGHT. Per bug #17700 from Xin Wen. Uselessness of the JOIN_RIGHT case pointed out by Richard Guo. Back-patch to v12 where this code was added. Discussion: https://postgr.es/m/17700-2b5c10d917c30687@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bb8d48cb9df1cb9266a73b24d7b6987019a90578 Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 24 +++++++++--------------- src/test/regress/expected/join.out | 20 ++++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Remove bogus Assert and dead code in remove_useless_results_recu @ 2022-11-29 15:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-11-29 15:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove bogus Assert and dead code in remove_useless_results_recurse(). The JOIN_SEMI case Assert'ed that there are no PlaceHolderVars that need to be evaluated at the semijoin's RHS, which is wrong because there could be some in the semijoin's qual condition. However, there could not be any references further up than that, and within the qual there is not any way that such a PHV could have gone to null yet, so we don't really need the PHV and there is no need to avoid making the RHS-removal optimization. The upshot is that there's no actual bug in production code, and we ought to just remove this misguided Assert. While we're here, also drop the JOIN_RIGHT case, which is dead code because reduce_outer_joins() already got rid of JOIN_RIGHT. Per bug #17700 from Xin Wen. Uselessness of the JOIN_RIGHT case pointed out by Richard Guo. Back-patch to v12 where this code was added. Discussion: https://postgr.es/m/17700-2b5c10d917c30687@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0224646beec657fb3a7791d237293ad4caea3255 Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 24 +++++++++--------------- src/test/regress/expected/join.out | 20 ++++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Remove bogus Assert and dead code in remove_useless_results_recu @ 2022-11-29 15:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-11-29 15:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove bogus Assert and dead code in remove_useless_results_recurse(). The JOIN_SEMI case Assert'ed that there are no PlaceHolderVars that need to be evaluated at the semijoin's RHS, which is wrong because there could be some in the semijoin's qual condition. However, there could not be any references further up than that, and within the qual there is not any way that such a PHV could have gone to null yet, so we don't really need the PHV and there is no need to avoid making the RHS-removal optimization. The upshot is that there's no actual bug in production code, and we ought to just remove this misguided Assert. While we're here, also drop the JOIN_RIGHT case, which is dead code because reduce_outer_joins() already got rid of JOIN_RIGHT. Per bug #17700 from Xin Wen. Uselessness of the JOIN_RIGHT case pointed out by Richard Guo. Back-patch to v12 where this code was added. Discussion: https://postgr.es/m/17700-2b5c10d917c30687@postgresql.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/556c0b913be150b92ee9fb250d2d5acc6d28f4c2 Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 24 +++++++++--------------- src/test/regress/expected/join.out | 20 ++++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2022-11-29 15:52 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-11-29 15:52 pgsql: Remove bogus Assert and dead code in remove_useless_results_recu Tom Lane <tgl@sss.pgh.pa.us> 2022-11-29 15:52 pgsql: Remove bogus Assert and dead code in remove_useless_results_recu Tom Lane <tgl@sss.pgh.pa.us> 2022-11-29 15:52 pgsql: Remove bogus Assert and dead code in remove_useless_results_recu Tom Lane <tgl@sss.pgh.pa.us> 2022-11-29 15:52 pgsql: Remove bogus Assert and dead code in remove_useless_results_recu Tom Lane <tgl@sss.pgh.pa.us> 2022-11-29 15:52 pgsql: Remove bogus Assert and dead code in remove_useless_results_recu 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