pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix incorrect logic for determining safe WindowAgg run condition
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix incorrect logic for determining safe WindowAgg run condition
@ 2023-03-17 02:50 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: David Rowley @ 2023-03-17 02:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix incorrect logic for determining safe WindowAgg run conditions

The logic added in 9d9c02ccd to determine when a qual can be used as a
WindowClause run condition failed to correctly check for subqueries in the
qual.  This was being done correctly for normal subquery qual pushdowns,
it's just that 9d9c02ccd failed to follow the lead on that.

This also fixes various other cases where transforming the qual into a
WindowClause run condition in the subquery should have been disallowed.

Bug: #17826
Reported-by: Anban Company
Discussion: https://postgr.es/m/17826-7d8750952f19a5f5@postgresql.org
Backpatch-through: 15, where 9d9c02ccd was introduced.

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/path/allpaths.c | 185 ++++++++++++++++++++++------------
src/test/regress/expected/window.out  |  43 +++++---
src/test/regress/sql/window.sql       |  17 +++-
3 files changed, 161 insertions(+), 84 deletions(-)



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

* pgsql: Fix incorrect logic for determining safe WindowAgg run condition
@ 2023-03-17 02:51 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: David Rowley @ 2023-03-17 02:51 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix incorrect logic for determining safe WindowAgg run conditions

The logic added in 9d9c02ccd to determine when a qual can be used as a
WindowClause run condition failed to correctly check for subqueries in the
qual.  This was being done correctly for normal subquery qual pushdowns,
it's just that 9d9c02ccd failed to follow the lead on that.

This also fixes various other cases where transforming the qual into a
WindowClause run condition in the subquery should have been disallowed.

Bug: #17826
Reported-by: Anban Company
Discussion: https://postgr.es/m/17826-7d8750952f19a5f5@postgresql.org
Backpatch-through: 15, where 9d9c02ccd was introduced.

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/371e3daaa53d09f1f265865dc9bf0dbff57c46ab

Modified Files
--------------
src/backend/optimizer/path/allpaths.c | 185 ++++++++++++++++++++++------------
src/test/regress/expected/window.out  |  43 +++++---
src/test/regress/sql/window.sql       |  17 +++-
3 files changed, 161 insertions(+), 84 deletions(-)



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


end of thread, other threads:[~2023-03-17 02:51 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17 02:50 pgsql: Fix incorrect logic for determining safe WindowAgg run condition David Rowley <drowley@postgresql.org>
2023-03-17 02:51 pgsql: Fix incorrect logic for determining safe WindowAgg run condition David Rowley <drowley@postgresql.org>

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