pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. @ 2024-08-09 15:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2024-08-09 15:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has been optimized out of the plan altogether on the grounds that no rows could pass the WHERE quals, which has been possible at least since 3fc6e2d7f. There isn't anything remaining in the plan tree that would help us, so fall back to printing the field name as "fN" for the N'th column of the record. (This will actually be the right thing some of the time, since it matches the column names we assign to RowExprs.) In passing, fix a comment typo in create_projection_plan, which I noticed while experimenting with an alternative fix for this. Per bug #18576 from Vasya B. Back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/18576-9feac34e132fea9e@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b919a97a6cd204cbd9b77d12c9e60ad59eea04a4 Modified Files -------------- src/backend/optimizer/plan/createplan.c | 2 +- src/backend/utils/adt/ruleutils.c | 50 ++++++++++++++++++++++-------- src/test/regress/expected/rowtypes.out | 54 +++++++++++++++++++++++++++++++++ src/test/regress/sql/rowtypes.sql | 21 +++++++++++++ 4 files changed, 113 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. @ 2024-08-09 15:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2024-08-09 15:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has been optimized out of the plan altogether on the grounds that no rows could pass the WHERE quals, which has been possible at least since 3fc6e2d7f. There isn't anything remaining in the plan tree that would help us, so fall back to printing the field name as "fN" for the N'th column of the record. (This will actually be the right thing some of the time, since it matches the column names we assign to RowExprs.) In passing, fix a comment typo in create_projection_plan, which I noticed while experimenting with an alternative fix for this. Per bug #18576 from Vasya B. Back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/18576-9feac34e132fea9e@postgresql.org Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/81a12a4477533d7722bd6b6dac88b0e798f8e85b Modified Files -------------- src/backend/optimizer/plan/createplan.c | 2 +- src/backend/utils/adt/ruleutils.c | 50 ++++++++++++++++++++++-------- src/test/regress/expected/rowtypes.out | 54 +++++++++++++++++++++++++++++++++ src/test/regress/sql/rowtypes.sql | 21 +++++++++++++ 4 files changed, 113 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. @ 2024-08-09 15:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2024-08-09 15:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has been optimized out of the plan altogether on the grounds that no rows could pass the WHERE quals, which has been possible at least since 3fc6e2d7f. There isn't anything remaining in the plan tree that would help us, so fall back to printing the field name as "fN" for the N'th column of the record. (This will actually be the right thing some of the time, since it matches the column names we assign to RowExprs.) In passing, fix a comment typo in create_projection_plan, which I noticed while experimenting with an alternative fix for this. Per bug #18576 from Vasya B. Back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/18576-9feac34e132fea9e@postgresql.org Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/03f679475d9ae6cafa1ea155e9f77255f245ef79 Modified Files -------------- src/backend/optimizer/plan/createplan.c | 2 +- src/backend/utils/adt/ruleutils.c | 50 ++++++++++++++++++++++-------- src/test/regress/expected/rowtypes.out | 54 +++++++++++++++++++++++++++++++++ src/test/regress/sql/rowtypes.sql | 21 +++++++++++++ 4 files changed, 113 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. @ 2024-08-09 15:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2024-08-09 15:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has been optimized out of the plan altogether on the grounds that no rows could pass the WHERE quals, which has been possible at least since 3fc6e2d7f. There isn't anything remaining in the plan tree that would help us, so fall back to printing the field name as "fN" for the N'th column of the record. (This will actually be the right thing some of the time, since it matches the column names we assign to RowExprs.) In passing, fix a comment typo in create_projection_plan, which I noticed while experimenting with an alternative fix for this. Per bug #18576 from Vasya B. Back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/18576-9feac34e132fea9e@postgresql.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/12010f4146156ae276e5e606400ed9ce39a83e0b Modified Files -------------- src/backend/optimizer/plan/createplan.c | 2 +- src/backend/utils/adt/ruleutils.c | 50 ++++++++++++++++++++++-------- src/test/regress/expected/rowtypes.out | 54 +++++++++++++++++++++++++++++++++ src/test/regress/sql/rowtypes.sql | 21 +++++++++++++ 4 files changed, 113 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. @ 2024-08-09 15:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2024-08-09 15:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has been optimized out of the plan altogether on the grounds that no rows could pass the WHERE quals, which has been possible at least since 3fc6e2d7f. There isn't anything remaining in the plan tree that would help us, so fall back to printing the field name as "fN" for the N'th column of the record. (This will actually be the right thing some of the time, since it matches the column names we assign to RowExprs.) In passing, fix a comment typo in create_projection_plan, which I noticed while experimenting with an alternative fix for this. Per bug #18576 from Vasya B. Back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/18576-9feac34e132fea9e@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/120dd033761dbd70ad6267ff7255430bc8a989ed Modified Files -------------- src/backend/optimizer/plan/createplan.c | 2 +- src/backend/utils/adt/ruleutils.c | 50 ++++++++++++++++++++++-------- src/test/regress/expected/rowtypes.out | 54 +++++++++++++++++++++++++++++++++ src/test/regress/sql/rowtypes.sql | 21 +++++++++++++ 4 files changed, 113 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. @ 2024-08-09 15:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2024-08-09 15:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has been optimized out of the plan altogether on the grounds that no rows could pass the WHERE quals, which has been possible at least since 3fc6e2d7f. There isn't anything remaining in the plan tree that would help us, so fall back to printing the field name as "fN" for the N'th column of the record. (This will actually be the right thing some of the time, since it matches the column names we assign to RowExprs.) In passing, fix a comment typo in create_projection_plan, which I noticed while experimenting with an alternative fix for this. Per bug #18576 from Vasya B. Back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/18576-9feac34e132fea9e@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3ad35d5022c9e5329906542150a19f9a38f9564d Modified Files -------------- src/backend/optimizer/plan/createplan.c | 2 +- src/backend/utils/adt/ruleutils.c | 43 ++++++++++++++++++++------ src/test/regress/expected/rowtypes.out | 54 +++++++++++++++++++++++++++++++++ src/test/regress/sql/rowtypes.sql | 21 +++++++++++++ 4 files changed, 109 insertions(+), 11 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. @ 2024-08-09 15:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2024-08-09 15:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. To deparse a reference to a field of a RECORD-type output of a subquery, EXPLAIN normally digs down into the subquery's plan to try to discover exactly which anonymous RECORD type is meant. However, this can fail if the subquery has been optimized out of the plan altogether on the grounds that no rows could pass the WHERE quals, which has been possible at least since 3fc6e2d7f. There isn't anything remaining in the plan tree that would help us, so fall back to printing the field name as "fN" for the N'th column of the record. (This will actually be the right thing some of the time, since it matches the column names we assign to RowExprs.) In passing, fix a comment typo in create_projection_plan, which I noticed while experimenting with an alternative fix for this. Per bug #18576 from Vasya B. Back-patch to all supported branches. Richard Guo and Tom Lane Discussion: https://postgr.es/m/18576-9feac34e132fea9e@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7408772de56302f72694943d44a660f35aaf410e Modified Files -------------- src/backend/optimizer/plan/createplan.c | 2 +- src/backend/utils/adt/ruleutils.c | 39 ++++++++++++++++++------ src/test/regress/expected/rowtypes.out | 54 +++++++++++++++++++++++++++++++++ src/test/regress/sql/rowtypes.sql | 21 +++++++++++++ 4 files changed, 105 insertions(+), 11 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2024-08-09 15:22 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-08-09 15:22 pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. Tom Lane <tgl@sss.pgh.pa.us> 2024-08-09 15:22 pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. Tom Lane <tgl@sss.pgh.pa.us> 2024-08-09 15:22 pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. Tom Lane <tgl@sss.pgh.pa.us> 2024-08-09 15:22 pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. Tom Lane <tgl@sss.pgh.pa.us> 2024-08-09 15:22 pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. Tom Lane <tgl@sss.pgh.pa.us> 2024-08-09 15:22 pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. Tom Lane <tgl@sss.pgh.pa.us> 2024-08-09 15:22 pgsql: Fix "failed to find plan for subquery/CTE" errors in EXPLAIN. 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