pgsql: In clause_is_computable_at(), test required_relids for clone cla
От | Tom Lane |
---|---|
Тема | pgsql: In clause_is_computable_at(), test required_relids for clone cla |
Дата | |
Msg-id | E1q0ogx-0013XT-8R@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
In clause_is_computable_at(), test required_relids for clone clauses. Use the clause's required_relids not clause_relids for testing whether it is computable at the current join level, if it is a clone clause generated by deconstruct_distribute_oj_quals(). Arguably, this is more correct and we should do it for all clauses; that would at least remove the handwavy claim that we are doing it to save cycles compared to inspecting Vars individually. However, attempting to do that exposes that we are not being careful to compute an accurate value for required_relids in all cases. I'm unsure whether it's a good idea to attempt to do that for v16, or leave it as future clean-up. In the meantime, this quick hack demonstrably fixes some cases, so let's squeeze it in for beta1. Patch by me, but great thanks to Richard Guo for investigation and testing. The new test cases are all modeled on his examples. Discussion: https://postgr.es/m/CAMbWs4-_vwkBij4XOQ5ukxUvLgwTm0kS5_DO9CicUeKbEfKjUw@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b9c755a2f625b7dca6323804b140b016d95a0b1d Modified Files -------------- src/backend/optimizer/util/restrictinfo.c | 13 +++++- src/test/regress/expected/join.out | 68 +++++++++++++++++++++++++++++++ src/test/regress/sql/join.sql | 20 +++++++++ 3 files changed, 100 insertions(+), 1 deletion(-)
В списке pgsql-committers по дате отправления: