pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Remove unused parameter on check_and_push_window_quals
3+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2025-09-25 4be9024d57  Remove unused parameter from check_and_push_window_quals
* Remove unused parameter on check_and_push_window_quals
@ 2025-09-25 21:01 Matheus Alcantara <matheusssilv97@gmail.com>
  2025-09-25 21:50 ` Re: Remove unused parameter on check_and_push_window_quals David Rowley <dgrowleyml@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Matheus Alcantara @ 2025-09-25 21:01 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org

Hi,

While reading the check_and_push_window_quals() I realize that the Index
rti parameter is not being used by check_and_push_window_quals() and
find_window_run_conditions(). The attached patch remove this parameter
for these functions.

--
Matheus Alcantara

Attachments:

0001-Remove-unused-Index-rti-on-check_and_push_window_qua.patch (text/plain, 2.6K) download From 80a580a73fbc12200ea19e112ad1a583cec2d466 Mon Sep 17 00:00:00 2001 From: Matheus Alcantara <mths.dev@pm.me> Date: Thu, 25 Sep 2025 17:54:48 -0300 Subject: [PATCH] Remove unused Index rti on check_and_push_window_quals --- src/backend/optimizer/path/allpaths.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 4e1c7084c88..dfd661c9e3b 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -2253,7 +2253,7 @@ set_dummy_rel_pathlist(RelOptInfo *rel) * return false. */ static bool -find_window_run_conditions(Query *subquery, RangeTblEntry *rte, Index rti, +find_window_run_conditions(Query *subquery, RangeTblEntry *rte, AttrNumber attno, WindowFunc *wfunc, OpExpr *opexpr, bool wfunc_left, bool *keep_original, Bitmapset **run_cond_attrs) @@ -2444,7 +2444,7 @@ find_window_run_conditions(Query *subquery, RangeTblEntry *rte, Index rti, * will use the runCondition to stop returning tuples. */ static bool -check_and_push_window_quals(Query *subquery, RangeTblEntry *rte, Index rti, +check_and_push_window_quals(Query *subquery, RangeTblEntry *rte, Node *clause, Bitmapset **run_cond_attrs) { OpExpr *opexpr = (OpExpr *) clause; @@ -2484,7 +2484,7 @@ check_and_push_window_quals(Query *subquery, RangeTblEntry *rte, Index rti, TargetEntry *tle = list_nth(subquery->targetList, var1->varattno - 1); WindowFunc *wfunc = (WindowFunc *) tle->expr; - if (find_window_run_conditions(subquery, rte, rti, tle->resno, wfunc, + if (find_window_run_conditions(subquery, rte, tle->resno, wfunc, opexpr, true, &keep_original, run_cond_attrs)) return keep_original; @@ -2497,7 +2497,7 @@ check_and_push_window_quals(Query *subquery, RangeTblEntry *rte, Index rti, TargetEntry *tle = list_nth(subquery->targetList, var2->varattno - 1); WindowFunc *wfunc = (WindowFunc *) tle->expr; - if (find_window_run_conditions(subquery, rte, rti, tle->resno, wfunc, + if (find_window_run_conditions(subquery, rte, tle->resno, wfunc, opexpr, false, &keep_original, run_cond_attrs)) return keep_original; @@ -2621,7 +2621,7 @@ set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel, * runCondition. */ if (!subquery->hasWindowFuncs || - check_and_push_window_quals(subquery, rte, rti, clause, + check_and_push_window_quals(subquery, rte, clause, &run_cond_attrs)) { /* -- 2.39.5 (Apple Git-154)
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: Remove unused parameter on check_and_push_window_quals
  2025-09-25 21:01 Remove unused parameter on check_and_push_window_quals Matheus Alcantara <matheusssilv97@gmail.com>
@ 2025-09-25 21:50 ` David Rowley <dgrowleyml@gmail.com>
  2025-09-25 22:23   ` Re: Remove unused parameter on check_and_push_window_quals David Rowley <dgrowleyml@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: David Rowley @ 2025-09-25 21:50 UTC (permalink / raw)
  To: Matheus Alcantara <matheusssilv97@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org

On Fri, 26 Sept 2025 at 09:01, Matheus Alcantara
<matheusssilv97@gmail.com> wrote:
> While reading the check_and_push_window_quals() I realize that the Index
> rti parameter is not being used by check_and_push_window_quals() and
> find_window_run_conditions(). The attached patch remove this parameter
> for these functions.

Thanks. I'll have a look at this.

David





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

* Re: Remove unused parameter on check_and_push_window_quals
  2025-09-25 21:01 Remove unused parameter on check_and_push_window_quals Matheus Alcantara <matheusssilv97@gmail.com>
  2025-09-25 21:50 ` Re: Remove unused parameter on check_and_push_window_quals David Rowley <dgrowleyml@gmail.com>
@ 2025-09-25 22:23   ` David Rowley <dgrowleyml@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: David Rowley @ 2025-09-25 22:23 UTC (permalink / raw)
  To: Matheus Alcantara <matheusssilv97@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org

On Fri, 26 Sept 2025 at 09:50, David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Fri, 26 Sept 2025 at 09:01, Matheus Alcantara
> <matheusssilv97@gmail.com> wrote:
> > While reading the check_and_push_window_quals() I realize that the Index
> > rti parameter is not being used by check_and_push_window_quals() and
> > find_window_run_conditions(). The attached patch remove this parameter
> > for these functions.
>
> Thanks. I'll have a look at this.

Seems to have been around since that feature was added. Thanks for
noticing. Pushed.

David





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


end of thread, other threads:[~2025-09-25 22:23 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-25 21:01 Remove unused parameter on check_and_push_window_quals Matheus Alcantara <matheusssilv97@gmail.com>
2025-09-25 21:50 ` David Rowley <dgrowleyml@gmail.com>
2025-09-25 22:23   ` David Rowley <dgrowleyml@gmail.com>

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