pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Change more places to be less trusting of RestrictInfo.is_pushed
6+ messages / 1 participants
[nested] [flat]

* pgsql: Change more places to be less trusting of RestrictInfo.is_pushed
@ 2018-04-20 19:19 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-20 19:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change more places to be less trusting of RestrictInfo.is_pushed_down.

On further reflection, commit e5d83995e didn't go far enough: pretty much
everywhere in the planner that examines a clause's is_pushed_down flag
ought to be changed to use the more complicated behavior where we also
check the clause's required_relids.  Otherwise we could make incorrect
decisions about whether, say, a clause is safe to use as a hash clause.

Some (many?) of these places are safe as-is, either because they are
never reached while considering a parameterized path, or because there
are additional checks that would reject a pushed-down clause anyway.
However, it seems smarter to just code them all the same way rather
than rely on easily-broken reasoning of that sort.

In support of that, invent a new macro RINFO_IS_PUSHED_DOWN that should
be used in place of direct tests on the is_pushed_down flag.

Like the previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c792c7db41466ff02107e3233ec9d92d8e3df866

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c       |  3 ++-
src/backend/optimizer/path/costsize.c     | 10 +++++++--
src/backend/optimizer/path/joinpath.c     |  4 ++--
src/backend/optimizer/path/joinrels.c     | 34 ++++++++++++++++++-------------
src/backend/optimizer/plan/analyzejoins.c | 10 ++++-----
src/backend/optimizer/plan/initsplan.c    |  5 +++++
src/backend/optimizer/util/relnode.c      |  3 ++-
src/backend/optimizer/util/restrictinfo.c | 12 ++---------
src/include/nodes/relation.h              | 17 +++++++++++++++-
src/include/optimizer/paths.h             |  3 ++-
10 files changed, 64 insertions(+), 37 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Change more places to be less trusting of RestrictInfo.is_pushed
@ 2018-04-20 19:19 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-20 19:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change more places to be less trusting of RestrictInfo.is_pushed_down.

On further reflection, commit e5d83995e didn't go far enough: pretty much
everywhere in the planner that examines a clause's is_pushed_down flag
ought to be changed to use the more complicated behavior where we also
check the clause's required_relids.  Otherwise we could make incorrect
decisions about whether, say, a clause is safe to use as a hash clause.

Some (many?) of these places are safe as-is, either because they are
never reached while considering a parameterized path, or because there
are additional checks that would reject a pushed-down clause anyway.
However, it seems smarter to just code them all the same way rather
than rely on easily-broken reasoning of that sort.

In support of that, invent a new macro RINFO_IS_PUSHED_DOWN that should
be used in place of direct tests on the is_pushed_down flag.

Like the previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8b6294c7a560c115fb9027e9cc5a3eee17fdf419

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c       |  3 ++-
src/backend/optimizer/path/costsize.c     | 10 ++++++++--
src/backend/optimizer/path/joinpath.c     |  4 ++--
src/backend/optimizer/path/joinrels.c     | 30 +++++++++++++++++-------------
src/backend/optimizer/plan/analyzejoins.c | 10 +++++-----
src/backend/optimizer/plan/initsplan.c    |  5 +++++
src/backend/optimizer/util/restrictinfo.c | 12 ++----------
src/include/nodes/relation.h              | 17 ++++++++++++++++-
8 files changed, 57 insertions(+), 34 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Change more places to be less trusting of RestrictInfo.is_pushed
@ 2018-04-20 19:19 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-20 19:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change more places to be less trusting of RestrictInfo.is_pushed_down.

On further reflection, commit e5d83995e didn't go far enough: pretty much
everywhere in the planner that examines a clause's is_pushed_down flag
ought to be changed to use the more complicated behavior where we also
check the clause's required_relids.  Otherwise we could make incorrect
decisions about whether, say, a clause is safe to use as a hash clause.

Some (many?) of these places are safe as-is, either because they are
never reached while considering a parameterized path, or because there
are additional checks that would reject a pushed-down clause anyway.
However, it seems smarter to just code them all the same way rather
than rely on easily-broken reasoning of that sort.

In support of that, invent a new macro RINFO_IS_PUSHED_DOWN that should
be used in place of direct tests on the is_pushed_down flag.

Like the previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/64ad85860ce6b3a7ce01a392f90a322bf61d068f

Modified Files
--------------
src/backend/optimizer/path/costsize.c     | 10 ++++++++--
src/backend/optimizer/path/joinpath.c     |  4 ++--
src/backend/optimizer/path/joinrels.c     | 30 +++++++++++++++++-------------
src/backend/optimizer/plan/analyzejoins.c |  6 ++----
src/backend/optimizer/plan/initsplan.c    |  5 +++++
src/backend/optimizer/util/restrictinfo.c | 12 ++----------
src/include/nodes/relation.h              | 17 ++++++++++++++++-
7 files changed, 52 insertions(+), 32 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Change more places to be less trusting of RestrictInfo.is_pushed
@ 2018-04-20 19:19 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-20 19:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change more places to be less trusting of RestrictInfo.is_pushed_down.

On further reflection, commit e5d83995e didn't go far enough: pretty much
everywhere in the planner that examines a clause's is_pushed_down flag
ought to be changed to use the more complicated behavior where we also
check the clause's required_relids.  Otherwise we could make incorrect
decisions about whether, say, a clause is safe to use as a hash clause.

Some (many?) of these places are safe as-is, either because they are
never reached while considering a parameterized path, or because there
are additional checks that would reject a pushed-down clause anyway.
However, it seems smarter to just code them all the same way rather
than rely on easily-broken reasoning of that sort.

In support of that, invent a new macro RINFO_IS_PUSHED_DOWN that should
be used in place of direct tests on the is_pushed_down flag.

Like the previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/80e12a6218761f444d1dae38c9545b9b18c48f18

Modified Files
--------------
src/backend/optimizer/path/costsize.c     | 10 ++++++++--
src/backend/optimizer/path/joinpath.c     |  4 ++--
src/backend/optimizer/path/joinrels.c     | 30 +++++++++++++++++-------------
src/backend/optimizer/plan/analyzejoins.c |  6 ++----
src/backend/optimizer/plan/initsplan.c    |  5 +++++
src/backend/optimizer/util/restrictinfo.c | 12 ++----------
src/include/nodes/relation.h              | 17 ++++++++++++++++-
7 files changed, 52 insertions(+), 32 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Change more places to be less trusting of RestrictInfo.is_pushed
@ 2018-04-20 19:19 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-20 19:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change more places to be less trusting of RestrictInfo.is_pushed_down.

On further reflection, commit e5d83995e didn't go far enough: pretty much
everywhere in the planner that examines a clause's is_pushed_down flag
ought to be changed to use the more complicated behavior where we also
check the clause's required_relids.  Otherwise we could make incorrect
decisions about whether, say, a clause is safe to use as a hash clause.

Some (many?) of these places are safe as-is, either because they are
never reached while considering a parameterized path, or because there
are additional checks that would reject a pushed-down clause anyway.
However, it seems smarter to just code them all the same way rather
than rely on easily-broken reasoning of that sort.

In support of that, invent a new macro RINFO_IS_PUSHED_DOWN that should
be used in place of direct tests on the is_pushed_down flag.

Like the previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/58fec95268dc925b8ae77dd50589c004b43202ba

Modified Files
--------------
src/backend/optimizer/path/costsize.c     | 10 ++++++++--
src/backend/optimizer/path/joinpath.c     |  4 ++--
src/backend/optimizer/path/joinrels.c     | 30 +++++++++++++++++-------------
src/backend/optimizer/plan/analyzejoins.c |  6 ++----
src/backend/optimizer/plan/initsplan.c    |  5 +++++
src/backend/optimizer/util/restrictinfo.c | 12 ++----------
src/include/nodes/relation.h              | 17 ++++++++++++++++-
7 files changed, 52 insertions(+), 32 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Change more places to be less trusting of RestrictInfo.is_pushed
@ 2018-04-20 19:19 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2018-04-20 19:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change more places to be less trusting of RestrictInfo.is_pushed_down.

On further reflection, commit e5d83995e didn't go far enough: pretty much
everywhere in the planner that examines a clause's is_pushed_down flag
ought to be changed to use the more complicated behavior where we also
check the clause's required_relids.  Otherwise we could make incorrect
decisions about whether, say, a clause is safe to use as a hash clause.

Some (many?) of these places are safe as-is, either because they are
never reached while considering a parameterized path, or because there
are additional checks that would reject a pushed-down clause anyway.
However, it seems smarter to just code them all the same way rather
than rely on easily-broken reasoning of that sort.

In support of that, invent a new macro RINFO_IS_PUSHED_DOWN that should
be used in place of direct tests on the is_pushed_down flag.

Like the previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9680c120e5b20898f563ccf18c39713d9b754292

Modified Files
--------------
src/backend/optimizer/path/costsize.c     | 10 ++++++++--
src/backend/optimizer/path/joinpath.c     |  4 ++--
src/backend/optimizer/path/joinrels.c     | 30 +++++++++++++++++-------------
src/backend/optimizer/plan/analyzejoins.c |  6 ++----
src/backend/optimizer/plan/initsplan.c    |  5 +++++
src/backend/optimizer/util/restrictinfo.c | 12 ++----------
src/include/nodes/relation.h              | 17 ++++++++++++++++-
7 files changed, 52 insertions(+), 32 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2018-04-20 19:19 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20 19:19 pgsql: Change more places to be less trusting of RestrictInfo.is_pushed Tom Lane <tgl@sss.pgh.pa.us>
2018-04-20 19:19 pgsql: Change more places to be less trusting of RestrictInfo.is_pushed Tom Lane <tgl@sss.pgh.pa.us>
2018-04-20 19:19 pgsql: Change more places to be less trusting of RestrictInfo.is_pushed Tom Lane <tgl@sss.pgh.pa.us>
2018-04-20 19:19 pgsql: Change more places to be less trusting of RestrictInfo.is_pushed Tom Lane <tgl@sss.pgh.pa.us>
2018-04-20 19:19 pgsql: Change more places to be less trusting of RestrictInfo.is_pushed Tom Lane <tgl@sss.pgh.pa.us>
2018-04-20 19:19 pgsql: Change more places to be less trusting of RestrictInfo.is_pushed 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