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 on check_and_push_window_quals
Date: Thu, 25 Sep 2025 18:01:40 -0300
Message-ID: <DD26NJ0Y34ZS.2ZOJPHSY12PFI@gmail.com> (raw )
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)
view thread (3+ messages) latest in thread
Message-ID: <DD26NJ0Y34ZS.2ZOJPHSY12PFI@gmail.com>
Permalink: ../DD26NJ0Y34ZS.2ZOJPHSY12PFI@gmail.com/
Also on: postgresql.org/message-id/DD26NJ0Y34ZS.2ZOJPHSY12PFI@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 on check_and_push_window_quals
In-Reply-To: <DD26NJ0Y34ZS.2ZOJPHSY12PFI@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