pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Teach reparameterize_path() to handle AppendPaths. 6+ messages / 1 participants [nested] [flat]
* pgsql: Teach reparameterize_path() to handle AppendPaths. @ 2018-01-23 21:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2018-01-23 21:50 UTC (permalink / raw) To: pgsql-committers Teach reparameterize_path() to handle AppendPaths. If we're inside a lateral subquery, there may be no unparameterized paths for a particular child relation of an appendrel, in which case we *must* be able to create similarly-parameterized paths for each other child relation, else the planner will fail with "could not devise a query plan for the given query". This means that there are situations where we'd better be able to reparameterize at least one path for each child. This calls into question the assumption in reparameterize_path() that it can just punt if it feels like it. However, the only case that is known broken right now is where the child is itself an appendrel so that all its paths are AppendPaths. (I think possibly I disregarded that in the original coding on the theory that nested appendrels would get folded together --- but that only happens *after* reparameterize_path(), so it's not excused from handling a child AppendPath.) Given that this code's been like this since 9.3 when LATERAL was introduced, it seems likely we'd have heard of other cases by now if there were a larger problem. Per report from Elvis Pranskevichus. Back-patch to 9.3. Discussion: https://postgr.es/m/5981018.zdth1YWmNy@hammer.magicstack.net Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/bb94ce4d26c3b011c01bf44ab200334fea52b600 Modified Files -------------- src/backend/optimizer/util/pathnode.c | 34 ++++++++++++++++++++++++++++++++++ src/test/regress/expected/join.out | 19 +++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 63 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Teach reparameterize_path() to handle AppendPaths. @ 2018-01-23 21:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2018-01-23 21:50 UTC (permalink / raw) To: pgsql-committers Teach reparameterize_path() to handle AppendPaths. If we're inside a lateral subquery, there may be no unparameterized paths for a particular child relation of an appendrel, in which case we *must* be able to create similarly-parameterized paths for each other child relation, else the planner will fail with "could not devise a query plan for the given query". This means that there are situations where we'd better be able to reparameterize at least one path for each child. This calls into question the assumption in reparameterize_path() that it can just punt if it feels like it. However, the only case that is known broken right now is where the child is itself an appendrel so that all its paths are AppendPaths. (I think possibly I disregarded that in the original coding on the theory that nested appendrels would get folded together --- but that only happens *after* reparameterize_path(), so it's not excused from handling a child AppendPath.) Given that this code's been like this since 9.3 when LATERAL was introduced, it seems likely we'd have heard of other cases by now if there were a larger problem. Per report from Elvis Pranskevichus. Back-patch to 9.3. Discussion: https://postgr.es/m/5981018.zdth1YWmNy@hammer.magicstack.net Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c5e59bb602e5b0bf15a8eb001eac8b31892ea037 Modified Files -------------- src/backend/optimizer/util/pathnode.c | 24 ++++++++++++++++++++++++ src/test/regress/expected/join.out | 19 +++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 53 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Teach reparameterize_path() to handle AppendPaths. @ 2018-01-23 21:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2018-01-23 21:50 UTC (permalink / raw) To: pgsql-committers Teach reparameterize_path() to handle AppendPaths. If we're inside a lateral subquery, there may be no unparameterized paths for a particular child relation of an appendrel, in which case we *must* be able to create similarly-parameterized paths for each other child relation, else the planner will fail with "could not devise a query plan for the given query". This means that there are situations where we'd better be able to reparameterize at least one path for each child. This calls into question the assumption in reparameterize_path() that it can just punt if it feels like it. However, the only case that is known broken right now is where the child is itself an appendrel so that all its paths are AppendPaths. (I think possibly I disregarded that in the original coding on the theory that nested appendrels would get folded together --- but that only happens *after* reparameterize_path(), so it's not excused from handling a child AppendPath.) Given that this code's been like this since 9.3 when LATERAL was introduced, it seems likely we'd have heard of other cases by now if there were a larger problem. Per report from Elvis Pranskevichus. Back-patch to 9.3. Discussion: https://postgr.es/m/5981018.zdth1YWmNy@hammer.magicstack.net Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ae3699a6ae55f370bfd7f169a46f89f4aca84f27 Modified Files -------------- src/backend/optimizer/util/pathnode.c | 23 +++++++++++++++++++++++ src/test/regress/expected/join.out | 19 +++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 52 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Teach reparameterize_path() to handle AppendPaths. @ 2018-01-23 21:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2018-01-23 21:50 UTC (permalink / raw) To: pgsql-committers Teach reparameterize_path() to handle AppendPaths. If we're inside a lateral subquery, there may be no unparameterized paths for a particular child relation of an appendrel, in which case we *must* be able to create similarly-parameterized paths for each other child relation, else the planner will fail with "could not devise a query plan for the given query". This means that there are situations where we'd better be able to reparameterize at least one path for each child. This calls into question the assumption in reparameterize_path() that it can just punt if it feels like it. However, the only case that is known broken right now is where the child is itself an appendrel so that all its paths are AppendPaths. (I think possibly I disregarded that in the original coding on the theory that nested appendrels would get folded together --- but that only happens *after* reparameterize_path(), so it's not excused from handling a child AppendPath.) Given that this code's been like this since 9.3 when LATERAL was introduced, it seems likely we'd have heard of other cases by now if there were a larger problem. Per report from Elvis Pranskevichus. Back-patch to 9.3. Discussion: https://postgr.es/m/5981018.zdth1YWmNy@hammer.magicstack.net Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8a2228b2f5dc7a52590cef97bf496fcf143db6de Modified Files -------------- src/backend/optimizer/util/pathnode.c | 22 ++++++++++++++++++++++ src/test/regress/expected/join.out | 19 +++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 51 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Teach reparameterize_path() to handle AppendPaths. @ 2018-01-23 21:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2018-01-23 21:50 UTC (permalink / raw) To: pgsql-committers Teach reparameterize_path() to handle AppendPaths. If we're inside a lateral subquery, there may be no unparameterized paths for a particular child relation of an appendrel, in which case we *must* be able to create similarly-parameterized paths for each other child relation, else the planner will fail with "could not devise a query plan for the given query". This means that there are situations where we'd better be able to reparameterize at least one path for each child. This calls into question the assumption in reparameterize_path() that it can just punt if it feels like it. However, the only case that is known broken right now is where the child is itself an appendrel so that all its paths are AppendPaths. (I think possibly I disregarded that in the original coding on the theory that nested appendrels would get folded together --- but that only happens *after* reparameterize_path(), so it's not excused from handling a child AppendPath.) Given that this code's been like this since 9.3 when LATERAL was introduced, it seems likely we'd have heard of other cases by now if there were a larger problem. Per report from Elvis Pranskevichus. Back-patch to 9.3. Discussion: https://postgr.es/m/5981018.zdth1YWmNy@hammer.magicstack.net Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/54e1599c76dfa90d179b61615f6473c437cf94f1 Modified Files -------------- src/backend/optimizer/util/pathnode.c | 22 ++++++++++++++++++++++ src/test/regress/expected/join.out | 19 +++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 51 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Teach reparameterize_path() to handle AppendPaths. @ 2018-01-23 21:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2018-01-23 21:50 UTC (permalink / raw) To: pgsql-committers Teach reparameterize_path() to handle AppendPaths. If we're inside a lateral subquery, there may be no unparameterized paths for a particular child relation of an appendrel, in which case we *must* be able to create similarly-parameterized paths for each other child relation, else the planner will fail with "could not devise a query plan for the given query". This means that there are situations where we'd better be able to reparameterize at least one path for each child. This calls into question the assumption in reparameterize_path() that it can just punt if it feels like it. However, the only case that is known broken right now is where the child is itself an appendrel so that all its paths are AppendPaths. (I think possibly I disregarded that in the original coding on the theory that nested appendrels would get folded together --- but that only happens *after* reparameterize_path(), so it's not excused from handling a child AppendPath.) Given that this code's been like this since 9.3 when LATERAL was introduced, it seems likely we'd have heard of other cases by now if there were a larger problem. Per report from Elvis Pranskevichus. Back-patch to 9.3. Discussion: https://postgr.es/m/5981018.zdth1YWmNy@hammer.magicstack.net Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b100a5274ffa4f29b4441eb17fe2a909f3074b79 Modified Files -------------- src/backend/optimizer/util/pathnode.c | 22 ++++++++++++++++++++++ src/test/regress/expected/join.out | 19 +++++++++++++++++++ src/test/regress/sql/join.sql | 10 ++++++++++ 3 files changed, 51 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2018-01-23 21:50 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-01-23 21:50 pgsql: Teach reparameterize_path() to handle AppendPaths. Tom Lane <tgl@sss.pgh.pa.us> 2018-01-23 21:50 pgsql: Teach reparameterize_path() to handle AppendPaths. Tom Lane <tgl@sss.pgh.pa.us> 2018-01-23 21:50 pgsql: Teach reparameterize_path() to handle AppendPaths. Tom Lane <tgl@sss.pgh.pa.us> 2018-01-23 21:50 pgsql: Teach reparameterize_path() to handle AppendPaths. Tom Lane <tgl@sss.pgh.pa.us> 2018-01-23 21:50 pgsql: Teach reparameterize_path() to handle AppendPaths. Tom Lane <tgl@sss.pgh.pa.us> 2018-01-23 21:50 pgsql: Teach reparameterize_path() to handle AppendPaths. 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