Re: On disable_cost - Mailing list pgsql-hackers

From Richard Guo
Subject Re: On disable_cost
Date
Msg-id CAMbWs4_SJhri4w1=_=gNUSOzV2fgUkh0_fex2oyebMRwm1ANQg@mail.gmail.com
Whole thread Raw
In response to Re: On disable_cost  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: On disable_cost
Re: On disable_cost
List pgsql-hackers
On Fri, Sep 6, 2024 at 5:00 PM Alexander Lakhin <exclusion@gmail.com> wrote:
> static void
> label_sort_with_costsize(PlannerInfo *root, Sort *plan, double limit_tuples)
> {
> ...
>      cost_sort(&sort_path, root, NIL,
>                lefttree->total_cost,
>                plan->plan.disabled_nodes,
>                lefttree->plan_rows,
>                lefttree->plan_width,
>                0.0,
>                work_mem,
>                limit_tuples);
>
> Given the cost_sort() declaration:
> void
> cost_sort(Path *path, PlannerInfo *root,
>            List *pathkeys, int input_disabled_nodes,
>            Cost input_cost, double tuples, int width,
>            Cost comparison_cost, int sort_mem,
>            double limit_tuples)
>
> Aren't the input_disabled_nodes and input_cost arguments swapped in the
> above call?

Nice catch!  I checked other callers to cost_sort, and they are all
good.

(I'm a little surprised that this does not cause any plan diffs in the
regression tests.)

Thanks
Richard



pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: On disable_cost
Next
From: Daniel Gustafsson
Date:
Subject: Re: Typos in the code and README