Remove unused parameter from check_and_push_window_quals
authorDavid Rowley <drowley@postgresql.org>
Thu, 25 Sep 2025 22:21:30 +0000 (10:21 +1200)
committerDavid Rowley <drowley@postgresql.org>
Thu, 25 Sep 2025 22:21:30 +0000 (10:21 +1200)
... and find_window_run_conditions.

This seems to have been around and unused ever since the Run Condition
feature was added in 9d9c02ccd.  Let's remove it to clean things up a
bit.

Author: Matheus Alcantara <matheusssilv97@gmail.com>
Discussion: https://postgr.es/m/DD26NJ0Y34ZS.2ZOJPHSY12PFI@gmail.com

src/backend/optimizer/path/allpaths.c

index 6cc6966b0600acb3fda3b8cafd1e2ec6c700fb7a..132e8a35a39f2601280571693327e40a28d25d3b 100644 (file)
@@ -2254,7 +2254,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)
@@ -2445,8 +2445,8 @@ 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,
-                           Node *clause, Bitmapset **run_cond_attrs)
+check_and_push_window_quals(Query *subquery, RangeTblEntry *rte, Node *clause,
+                           Bitmapset **run_cond_attrs)
 {
    OpExpr     *opexpr = (OpExpr *) clause;
    bool        keep_original = true;
@@ -2485,7 +2485,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;
@@ -2498,7 +2498,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;
@@ -2622,7 +2622,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))
                    {
                        /*