Re: BUG #17495: Regression in 15beta1 when filtering subquery including row_number window function
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>,
Michael Paquier <michael@paquier.xyz>, jeremyevans0@gmail.com,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-05-25T22:39:46Z
Lists: pgsql-bugs
David Rowley <dgrowleyml@gmail.com> writes: > Maybe a better fix is to add a new Bitmapset field to WindowClause and > have find_window_run_conditions() record the attno in that field when > it appends the new runCondition to the runCondition field. > remove_unused_subquery_outputs() can just bms_add_members that field > to attrs_used. This just means having to add a field to WindowClause > post-beta. Is that going to be a problem? It'd mean a forced initdb, which is not great, but unless 0ff20288e gets reverted there'd be no additional impact on beta testers. A bigger problem with what you describe is that I don't really think the planner should be mucking with the input parse tree like that. Can't we retain this information somewhere else instead, in storage associated with the PlannerInfo? regards, tom lane
Commits
-
Teach remove_unused_subquery_outputs about window run conditions
- 3e9abd2eb1b1 15.0 landed