pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Matheus Alcantara <matheusssilv97@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Subject: Remove unused parameter form find_window_run_conditions()
Date: Mon, 29 Sep 2025 10:23:03 -0300
Message-ID: <DD5BEKORUG34.2M8492NMB9DB8@gmail.com> (raw )
Hi,
Reading find_window_run_conditions() the RangeTableEntry *rte parameter
is not being used by find_window_run_conditions() and
check_and_push_window_quals(). The attached patch remove this parameter
from both functions.
The 4be9024d573 also remove unused parameter for both functions and
after studying more these functions I founded that the RangeTableEntry
is not being used as well. I've checked the other parameters and all
seems to be used now.
--
Matheus Alcantara
Attachments:
0001-Remove-unused-parameter-from-find_window_run_conditi.patch (text/plain, 2.6K) download
From 0eab4399507f3cb6ff4e0d1429089280d2136621 Mon Sep 17 00:00:00 2001
From: Matheus Alcantara <mths.dev@pm.me>
Date: Mon, 29 Sep 2025 10:14:50 -0300
Subject: [PATCH] Remove unused parameter from find_window_run_conditions()
... and check_and_push_window_quals()
---
src/backend/optimizer/path/allpaths.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 132e8a35a39..12925a115dd 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -2254,8 +2254,8 @@ set_dummy_rel_pathlist(RelOptInfo *rel)
* return false.
*/
static bool
-find_window_run_conditions(Query *subquery, RangeTblEntry *rte,
- AttrNumber attno, WindowFunc *wfunc, OpExpr *opexpr,
+find_window_run_conditions(Query *subquery, AttrNumber attno,
+ WindowFunc *wfunc, OpExpr *opexpr,
bool wfunc_left, bool *keep_original,
Bitmapset **run_cond_attrs)
{
@@ -2445,7 +2445,7 @@ find_window_run_conditions(Query *subquery, RangeTblEntry *rte,
* will use the runCondition to stop returning tuples.
*/
static bool
-check_and_push_window_quals(Query *subquery, RangeTblEntry *rte, Node *clause,
+check_and_push_window_quals(Query *subquery, Node *clause,
Bitmapset **run_cond_attrs)
{
OpExpr *opexpr = (OpExpr *) clause;
@@ -2485,7 +2485,7 @@ check_and_push_window_quals(Query *subquery, RangeTblEntry *rte, Node *clause,
TargetEntry *tle = list_nth(subquery->targetList, var1->varattno - 1);
WindowFunc *wfunc = (WindowFunc *) tle->expr;
- if (find_window_run_conditions(subquery, rte, tle->resno, wfunc,
+ if (find_window_run_conditions(subquery, tle->resno, wfunc,
opexpr, true, &keep_original,
run_cond_attrs))
return keep_original;
@@ -2498,7 +2498,7 @@ check_and_push_window_quals(Query *subquery, RangeTblEntry *rte, Node *clause,
TargetEntry *tle = list_nth(subquery->targetList, var2->varattno - 1);
WindowFunc *wfunc = (WindowFunc *) tle->expr;
- if (find_window_run_conditions(subquery, rte, tle->resno, wfunc,
+ if (find_window_run_conditions(subquery, tle->resno, wfunc,
opexpr, false, &keep_original,
run_cond_attrs))
return keep_original;
@@ -2622,7 +2622,7 @@ set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel,
* runCondition.
*/
if (!subquery->hasWindowFuncs ||
- check_and_push_window_quals(subquery, rte, clause,
+ check_and_push_window_quals(subquery, clause,
&run_cond_attrs))
{
/*
--
2.50.1 (Apple Git-155)
view thread (2+ messages) latest in thread
Message-ID: <DD5BEKORUG34.2M8492NMB9DB8@gmail.com>
Permalink: ../DD5BEKORUG34.2M8492NMB9DB8@gmail.com/
Also on: postgresql.org/message-id/DD5BEKORUG34.2M8492NMB9DB8@gmail.com
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: matheusssilv97@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Remove unused parameter form find_window_run_conditions()
In-Reply-To: <DD5BEKORUG34.2M8492NMB9DB8@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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