pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedRemove unused parameter form find_window_run_conditions()
2+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2025-09-29 b91067c899 Remove unused parameter from find_window_run_conditions()
* Remove unused parameter form find_window_run_conditions()
@ 2025-09-29 13:23 Matheus Alcantara <matheusssilv97@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Matheus Alcantara @ 2025-09-29 13:23 UTC (permalink / raw)
To: pgsql-hackers@lists.postgresql.org
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)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Remove unused parameter form find_window_run_conditions()
@ 2025-09-29 19:40 David Rowley <dgrowleyml@gmail.com>
parent: Matheus Alcantara <matheusssilv97@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: David Rowley @ 2025-09-29 19:40 UTC (permalink / raw)
To: Matheus Alcantara <matheusssilv97@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org
On Tue, 30 Sept 2025 at 02:23, Matheus Alcantara
<matheusssilv97@gmail.com> wrote:
> 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.
Well, I guess we'd better remove that one too. Thanks for the patch.
This time I checked the remaining ones, and it seems there are no
other unused ones this time.
Pushed.
David
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-09-29 19:40 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-29 13:23 Remove unused parameter form find_window_run_conditions() Matheus Alcantara <matheusssilv97@gmail.com>
2025-09-29 19:40 ` 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