pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. @ 2022-12-04 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-12-04 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix generate_partitionwise_join_paths() to tolerate failure. We might fail to generate a partitionwise join, because reparameterize_path_by_child() does not support all path types. This should not be a hard failure condition: we should just fall back to a non-partitioned join. However, generate_partitionwise_join_paths did not consider this possibility and would emit the (misleading) error "could not devise a query plan for the given query" if we'd failed to make any paths for a child join. Fix it to give up on partitionwise joining if so. (The accepted technique for giving up appears to be to set rel->nparts = 0, which I find pretty bizarre, but there you have it.) I have not added a test case because there'd be little point: any omissions of this sort that we identify would soon get fixed by extending reparameterize_path_by_child(), so the test would stop proving anything. However, right now there is a known test case based on failure to cover MaterialPath, and with that I've found that this is broken in all supported versions. Hence, patch all the way back. Original report and patch by me; thanks to Richard Guo for identifying a test case that works against committed versions. Discussion: https://postgr.es/m/1854233.1669949723@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/fe12f2f8fa608156c2d3c027cdd6aa9af0788e3a Modified Files -------------- src/backend/optimizer/path/allpaths.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. @ 2022-12-04 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-12-04 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix generate_partitionwise_join_paths() to tolerate failure. We might fail to generate a partitionwise join, because reparameterize_path_by_child() does not support all path types. This should not be a hard failure condition: we should just fall back to a non-partitioned join. However, generate_partitionwise_join_paths did not consider this possibility and would emit the (misleading) error "could not devise a query plan for the given query" if we'd failed to make any paths for a child join. Fix it to give up on partitionwise joining if so. (The accepted technique for giving up appears to be to set rel->nparts = 0, which I find pretty bizarre, but there you have it.) I have not added a test case because there'd be little point: any omissions of this sort that we identify would soon get fixed by extending reparameterize_path_by_child(), so the test would stop proving anything. However, right now there is a known test case based on failure to cover MaterialPath, and with that I've found that this is broken in all supported versions. Hence, patch all the way back. Original report and patch by me; thanks to Richard Guo for identifying a test case that works against committed versions. Discussion: https://postgr.es/m/1854233.1669949723@sss.pgh.pa.us Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bf8fd64ff5e65f8964d1b52c50019f0198ec5f5e Modified Files -------------- src/backend/optimizer/path/allpaths.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. @ 2022-12-04 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-12-04 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix generate_partitionwise_join_paths() to tolerate failure. We might fail to generate a partitionwise join, because reparameterize_path_by_child() does not support all path types. This should not be a hard failure condition: we should just fall back to a non-partitioned join. However, generate_partitionwise_join_paths did not consider this possibility and would emit the (misleading) error "could not devise a query plan for the given query" if we'd failed to make any paths for a child join. Fix it to give up on partitionwise joining if so. (The accepted technique for giving up appears to be to set rel->nparts = 0, which I find pretty bizarre, but there you have it.) I have not added a test case because there'd be little point: any omissions of this sort that we identify would soon get fixed by extending reparameterize_path_by_child(), so the test would stop proving anything. However, right now there is a known test case based on failure to cover MaterialPath, and with that I've found that this is broken in all supported versions. Hence, patch all the way back. Original report and patch by me; thanks to Richard Guo for identifying a test case that works against committed versions. Discussion: https://postgr.es/m/1854233.1669949723@sss.pgh.pa.us Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ec3daeec316ff999d3e8f12a3587cdb4d0af81b0 Modified Files -------------- src/backend/optimizer/path/allpaths.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. @ 2022-12-04 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-12-04 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix generate_partitionwise_join_paths() to tolerate failure. We might fail to generate a partitionwise join, because reparameterize_path_by_child() does not support all path types. This should not be a hard failure condition: we should just fall back to a non-partitioned join. However, generate_partitionwise_join_paths did not consider this possibility and would emit the (misleading) error "could not devise a query plan for the given query" if we'd failed to make any paths for a child join. Fix it to give up on partitionwise joining if so. (The accepted technique for giving up appears to be to set rel->nparts = 0, which I find pretty bizarre, but there you have it.) I have not added a test case because there'd be little point: any omissions of this sort that we identify would soon get fixed by extending reparameterize_path_by_child(), so the test would stop proving anything. However, right now there is a known test case based on failure to cover MaterialPath, and with that I've found that this is broken in all supported versions. Hence, patch all the way back. Original report and patch by me; thanks to Richard Guo for identifying a test case that works against committed versions. Discussion: https://postgr.es/m/1854233.1669949723@sss.pgh.pa.us Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4ebca555cf238628b933f79fd90fdd41bed4d39d Modified Files -------------- src/backend/optimizer/path/allpaths.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. @ 2022-12-04 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-12-04 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix generate_partitionwise_join_paths() to tolerate failure. We might fail to generate a partitionwise join, because reparameterize_path_by_child() does not support all path types. This should not be a hard failure condition: we should just fall back to a non-partitioned join. However, generate_partitionwise_join_paths did not consider this possibility and would emit the (misleading) error "could not devise a query plan for the given query" if we'd failed to make any paths for a child join. Fix it to give up on partitionwise joining if so. (The accepted technique for giving up appears to be to set rel->nparts = 0, which I find pretty bizarre, but there you have it.) I have not added a test case because there'd be little point: any omissions of this sort that we identify would soon get fixed by extending reparameterize_path_by_child(), so the test would stop proving anything. However, right now there is a known test case based on failure to cover MaterialPath, and with that I've found that this is broken in all supported versions. Hence, patch all the way back. Original report and patch by me; thanks to Richard Guo for identifying a test case that works against committed versions. Discussion: https://postgr.es/m/1854233.1669949723@sss.pgh.pa.us Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1ff549e844cc649b5f4f1bbab88404aaffebbfa4 Modified Files -------------- src/backend/optimizer/path/allpaths.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. @ 2022-12-04 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-12-04 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix generate_partitionwise_join_paths() to tolerate failure. We might fail to generate a partitionwise join, because reparameterize_path_by_child() does not support all path types. This should not be a hard failure condition: we should just fall back to a non-partitioned join. However, generate_partitionwise_join_paths did not consider this possibility and would emit the (misleading) error "could not devise a query plan for the given query" if we'd failed to make any paths for a child join. Fix it to give up on partitionwise joining if so. (The accepted technique for giving up appears to be to set rel->nparts = 0, which I find pretty bizarre, but there you have it.) I have not added a test case because there'd be little point: any omissions of this sort that we identify would soon get fixed by extending reparameterize_path_by_child(), so the test would stop proving anything. However, right now there is a known test case based on failure to cover MaterialPath, and with that I've found that this is broken in all supported versions. Hence, patch all the way back. Original report and patch by me; thanks to Richard Guo for identifying a test case that works against committed versions. Discussion: https://postgr.es/m/1854233.1669949723@sss.pgh.pa.us Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2df073313934a3787ec0e42dde4a06a879ae5e3a Modified Files -------------- src/backend/optimizer/path/allpaths.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2022-12-04 18:48 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-12-04 18:48 pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. Tom Lane <tgl@sss.pgh.pa.us> 2022-12-04 18:48 pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. Tom Lane <tgl@sss.pgh.pa.us> 2022-12-04 18:48 pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. Tom Lane <tgl@sss.pgh.pa.us> 2022-12-04 18:48 pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. Tom Lane <tgl@sss.pgh.pa.us> 2022-12-04 18:48 pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. Tom Lane <tgl@sss.pgh.pa.us> 2022-12-04 18:48 pgsql: Fix generate_partitionwise_join_paths() to tolerate failure. 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